GoogleContainerTools / GoogleContainerTools/skaffold

Proposal: Permit custom buildCommand to export skaffold ENV vars that could be referenced in later in skaffold.yaml templating

Open
#3,737 4 comments 8 reactions 0 assignees View on GitHub
kind/design discussion kind/feature-request priority/p2
Dominant language
Go
Stars
15.9k
Forks
1.7k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

Permit custom buildCommand to export skaffold ENV vars that could be referenced in Helm releases

Would be great if this:
```
build:
artifacts:
- image: myreg.test.com/my/my-app
custom:
buildCommand: ./builder.sh
...
```

Could (via STDOUT or other means) convey some variables that Skaffold could add to its execution environment whereby they could be referenced elsewhere in skaffold.yaml, i.e.

```
deploy:
helm:
releases:
- name: my-app-{{.SOME_VAR_SET_BY_BUILD_CMD}}
chartPath: bitsofinfo-appdeploy/appdeploy
remote: true
version: 1.1.14
...
```

maybe something like if the process has STDOUT that contains something like

```
skaffold.setenvvar.SOME_VAR_SET_BY_BUILD_CMD=myvalue
```
that could be exported into the skaffold environment for reference later on the templating in skaffold.yaml.

Really really could use this!

Azure pipelines has this kind of functionality so this is not unprecedented in the world of cicd.

https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#set-variables-in-scripts

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.