-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run-local.sh: Various cleanups, prepare for job-runner #589
Conversation
With job-runner, the repo will be cloned in a pristine environment. git will be rather unhappy to try and clone the "123abc" mock SHA.
curl an existing URL, to avoid printing the 404 page on success -- that's confusing when looking at the log.
This prepares us for testing job-runner, where the mock git command needs to be installed into the job container as well. Also write the log into a test attachment instead of /work. That way, we can access it regardless of where it ran.
When we'll move to job-runner, then `image-create` will not run in the cockpituous-tasks container any more. So instead of assuming that the image is already in /cache/images, download it from S3 instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 💚
export GITHUB_API=http://127.0.0.7:8443 | ||
until curl --silent \$GITHUB_API; do sleep 0.1; done | ||
export GITHUB_API=$GHAPI_URL_POD | ||
until curl --silent --fail \$GITHUB_API/repos/cockpit-project/bots; do sleep 0.1; done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I almost commented here that hardcoding this was bad, for example, but that's obviously non-sense in this case.
Sometimes I think it would be better to have named this repository something different. I always get confused about things on the real GitHub (which should allow for generalization based on which fork is running the tests) vs. our mocked-up stuff.
This is officially a drive-by.
echo "$@" >> "${TEST_ATTACHMENTS}/git-push.log" | ||
exit 0 | ||
fi | ||
exec /usr/bin/git "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not crazy about this, but it's probably the best option for the time being...
In a certain sense, this is mocking in its purest form...
@@ -46,7 +46,7 @@ jobs: | |||
- name: Check which containers changed | |||
id: containers_changed | |||
run: | | |||
tasks=$(git diff --name-only origin/main..HEAD -- tasks/ | grep -Ev 'run-local.sh|openssl.cnf|README|mock-github|.yaml' || true) | |||
tasks=$(git diff --name-only origin/main..HEAD -- tasks/ | grep -Ev 'run-local.sh|openssl.cnf|README|mock-|.yaml' || true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is starting to beg for a separate tasks/container/
directory...
Broken out of #586 -- these parts apply to the current infra. I re-triggered cockpit-project/bots#6017 and it is green now 💚 .