-
Notifications
You must be signed in to change notification settings - Fork 50
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
ci-automation: Follow-up fix for 2-phase nightly SDK build tags #799
Conversation
As GitHub Actions cannot run SDK builds yet, can you please start Jenkins SDK builds? |
Build action triggered: https://github.com/flatcar/scripts/actions/runs/6416606517 |
I discussed this with Thilo and will introduce a two-phase build flag to nightly builds job, so I can run it manually instead of waiting for Friday. |
Moved to backlog |
a4bb2b9
to
5574f3d
Compare
We push a commit with the nightly SDK tag to the main branch if the SDK was built from the main branch. Which is what happens when we build the nightly intermediate SDK. The final nightly SDK is not built from the main branch, but rather from the nightly intermediate SDK tag. Both of them point to the exactly same commit, but the difference is in what `git rev-parse --abbrev-ref HEAD` returns for each of those. When the main branch is checked out, the command will return "main". When the nightly intermediate SDK tag is checked out, the command will return "HEAD". So when nightly final SDK is being built, the command returns a string different than "main" and thus decides not to push the commit with the final nightly SDK tag to the main branch. Rework it to assume that if `git rev-parse HEAD` and `git rev-parse origin/main` return the same commit hash (and it's the nightly build and all that) then the commit should be pushed. We use "origin/main" instead of just "main" just in case the main branch was not checked out before, for some reason (may come up in testing with different names for the main branch when testing).
Changing the name of the main branch and the name of the nightly tag may be useful for testing, so let's have them defined in one place.
72f4e71
to
3440884
Compare
Tested it with my branch krnowak/fake-main (where I actually skip building stuff and focus on the tagging issue) and with some jenkins modifications to avoid running irrelevant jobs. See: http://jenkins.infra.kinvolk.io:8080/job/container/job/nightly/429/cldsv/ |
ci-automation: Follow-up fix for 2-phase nightly SDK build tags
ci-automation: Follow-up fix for 2-phase nightly SDK build tags
ci-automation: Follow-up fix for 2-phase nightly SDK build tags
ci-automation: Follow-up fix for 2-phase nightly SDK build tags
Backported to all branches |
The tagging function was changed in the scripts repo with flatcar/scripts#799 (not on all branches but this is solved now) and since the tag-release script uses it we also have to adjust the function call here.
We push a commit with the nightly SDK tag to the main branch if the SDK was built from the main branch. Which is what happens when we build the nightly intermediate SDK. The final nightly SDK is not built from the main branch, but rather from the nightly intermediate SDK tag. Both of them point to the exactly same commit, but the difference is in what
git rev-parse --abbrev-ref HEAD
returns for each of those. When the main branch is checked out, the command will return "main". When the nightly intermediate SDK tag is checked out, the command will return "HEAD". So when nightly final SDK is being built, the command returns a string different than "main" and thus decides not to push the commit with the final nightly SDK tag to the main branch. Rework it to assume that ifgit rev-parse HEAD
andgit rev-parse main
return the same commit hash (and it's the nightly build and all that) then the commit should be pushed.