-
Notifications
You must be signed in to change notification settings - Fork 82
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
feat: support building a release in a dockerised environment #756
Conversation
This will make the build reproducible across machines
This pull request does not have a backport label. Could you fix it @mdelapenya? 🙏
NOTE: |
This pull request does not have a backport label. Could you fix it @mdelapenya? 🙏
NOTE: |
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
you can use the docker golang-crossbuild images is a full Go build environment, this is a snippet from the bolt cli tool, it used the golang-crossbuild Docker images to build the binaries, also has support for cross-build if you needeed.
|
zip is not installed on golang-crossbuild images but we can add it and we use the same Docker image to build Go everywhere |
@kuisathaverat I will use your approach and add the cross build images, previously adding ZIP there. Thanks!! |
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.
LGTM
@kuisathaverat if you agree, let's do this in a follow-up PR |
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.
Approved, though there is a question regarding the implementation in CI Pipeline
@Mergifyio backport 7.17 |
❌ No backport have been created
|
What is the problem this PR solves?
This PR support building a release in an idempotent manner, where all build dependencies (Go and ZIP at this moment) are already present in the builder machine.
While building Fleet Server in a CI worker, we noticed that ZIP was not installed, and instead of creating "pet" workers with all tools installed, I considered automating the build at the project side, so that the build system is self-content, alowing developers to generate builds in a consistent manner.
How does this PR solve the problem?
It adds three make goals:
make release
as ENTRYPOINT). SeeDockerfile.build
for contentFinally, a new stage has been added to the main pipeline to check for release binaries existence. It's worth to say that this stage adds a few minutes to the pipeline, so maybe we can make it configurable... or maybe we discover it's so important that we agree in having those extra minutes.
How to test this PR locally
If the release test passes:
If the release test fails:
It will create all binaries under the
build/distributions
directory (as expected), and run the tests verifying they are created.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues