Skip to content
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

🔨 Improve build process: unifies go build commands, improve reliability of Make and Docker assets #174

Merged
merged 6 commits into from
Feb 4, 2021

Conversation

dduportal
Copy link
Contributor

This PRs aims at improving the build process with the following key points (each one is a separated commit to ease the review and can be eventually be removed):

  • Unifying all the go build commands into a single one. This avoid any future configuration shifts between developer's builds, CI builds and release builds.
  • Improve Makefile to ease the contribution experience (bugfixes around PHONY and missing dependencies + adding a help message)
  • Pin ubuntu version to the latest LTS (e.g. 20.04)
  • Nitpicking on trailing whitespaces
  • Faster Docker builds

This commit unifies all the different `go build` commands to
have a single source of truth.

It utilizes the script `utils/build.sh` which keep the same
default behavior (e.g. building all the OS+arch binaries).
But now, you can customize the `GOOS`, `GOARCH` and `CUSTOM_BINARY`
(e.g. destination for the binary) environment variables.

⚠️ Please note that there are edge cases when defining `CUSTOM_BINARY`
and multiple `GOOS` or `GOARCH`.

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
- Add a "help" target to list target (and description through comments)
- Add target dependencies for the `docker.*` targets
- Add required targets to .PHONY to avoid Make errors when directories
  or files with the same name exist

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Goals:
- Ensure that the behavior stay the same over time
- Avoid broken builds and scary warning messages in GitHub Actions

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
- Ignoring unecessary files from Docker's build context
- Enabling Docker BuildKit

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
@dduportal dduportal changed the title Improve build process: unifies go build commands, improve reliability of Make and Docker assets 🔨 Improve build process: unifies go build commands, improve reliability of Make and Docker assets Feb 2, 2021
@olblak olblak merged commit 34e94e2 into updatecli:main Feb 4, 2021
@dduportal dduportal deleted the chore/unify-build branch February 18, 2021 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants