-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Ensure clean go build environment for goreleaser and ko (#824)
Previous builds were overriding the `GOOS` and `GOARCH` enviroment variables, which is fine to do when using `ko` directly, but appears to be broken when building via ko using `goreleaser`. This commit ensures that `GOOS` and `GOARCH` are always unset when running builds by undefining them via `make` `undefine`. The `override` keyword ensures that the env vars are always undefined regardless of the source (e.g. enviroment, make variables, etc) to ensure a clean build environment. Instead of using `GOARCH` env var for building for the local build architecure, this commit uses `goreleaser`'s `{{ .Runtime.Goarch }}` variable available via templating which contains the architecture of the build machine. This commit also removes the `ldflags` config from the `ko` configuration in `goreleaser` config as this is automatically inherited from the `build` config referenced in the `ko` config.
- Loading branch information
1 parent
036d8f5
commit 3ac7bf0
Showing
4 changed files
with
23 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters