1
0
mirror of https://github.com/ko-build/ko.git synced 2025-11-29 22:47:51 +02:00
Commit Graph

12 Commits

Author SHA1 Message Date
Nathan Mittler
7cb29ac9b8 Refactor global values to be defaults
There was recent work to add global values for `env`, `flags`, and `ldflags`. The global values would be merged with per-build values to generate the value used for the builds.

There are a couple issues with this:

- It's inconsistent with the existing code, which only has `default` values declared globally (there is no merging today).
- The name of the `flag` variable, caused a conflict with knative's `KO_FLAGS` environment variable (see #1317)

This PR does the following:

- Refactors the logic to use `defaultEnv`, `defaultFlags`, and `defaultLdflags`. This resolves both issues described above.
- Updates documentation

Fixes #1317
2024-05-21 11:29:50 -04:00
Nathan Mittler
2a4c12f410 Add global flags and ldflags
Fixes #1304
2024-05-15 16:46:47 -04:00
Nathan Mittler
c42ee5f028 feat: add template params for platform info
This restructures the build logic in order to expand the buildArgs to include:

- `Env`: the actual environment variables used to execute the build. This includes platform info (e.g. `GOOS`, `GOARCH`).
- `GoEnv`: the map of variables from `go env`, but overridden with any platform-specific values defined in `Env`.

Fixes #1301

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
2024-05-15 14:49:18 -04:00
Nathan Mittler
4dbf90fe81 feat: Add template params for git
This includes a number of template parameters supported by [goreleaser](https://goreleaser.com/customization/templates/). Specifically, the build date information and the majority of the Git params.

Majority of the code is copied from goreleaser. I've added the MIT license from goreleaser at the top of the files.

Fixes #493

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
2024-05-15 11:27:55 -04:00
Nathan Mittler
067f9f7899 feat: Add global env
Supports configuring global `env` variables that will be applied to all builds.

Modifies the `builder` function to accept a `buildContext` structure. This will simplify similar modifications in the future.

Fixes #1305

Signed-off-by: Nathan Mittler <nmittler@aviatrix.com>
2024-05-14 13:58:53 -07:00
Amir Hardon
820ce2f90e Fix the KO_CONFIG_PATH default value in the documentation 2023-12-28 11:57:06 -08:00
Samuel Laferriere
220da75446 fixed typo in configuration.md 2023-07-31 11:38:53 -04:00
Michael Gasch
f6025f951e feat: Add KO_GO_PATH env var (#930)
* feat: Add KO_GO_BIN env var

Closes: #926
Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com>

* Update docs/configuration.md

Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com>
Co-authored-by: Jason Hall <jason@chainguard.dev>
2023-01-19 15:02:34 -05:00
Jason Hall
ffe5ac0071 update docs to reflect actual base image (#903) 2022-12-22 15:03:52 -05:00
Reto Lehmann
7dc51c0cf6 Add option to configure default platforms (#897) 2022-12-12 10:07:39 -05:00
Batuhan Apaydın
45240bf3f4 add KO_DEFAULTBASEIMAGE usage to docs (#895)
Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>

Signed-off-by: Batuhan Apaydın <batuhan.apaydin@trendyol.com>
2022-11-30 10:52:56 -05:00
Jason Hall
e1b4eade08 Move docs to ko.build (#749)
* Move docs to ko.build

* rm ko_deps.md

* remove trailing whitespace

* add go-import meta tag

* update mkdocs.yml

* update mkdocs.yml

* remove duplicate main.html

* update go.sum
2022-09-30 15:04:37 -04:00