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

GIT_SHA as build variable only/allowing setting of scope #210

Open
bomoko opened this issue Jun 8, 2023 · 0 comments · May be fixed by #211
Open

GIT_SHA as build variable only/allowing setting of scope #210

bomoko opened this issue Jun 8, 2023 · 0 comments · May be fixed by #211

Comments

@bomoko
Copy link
Contributor

bomoko commented Jun 8, 2023

I have some questions regarding the GIT_SHA environment variable.

Currently, we're going this, right

INJECT_GIT_SHA=$(cat .lagoon.yml | shyaml get-value environment_variables.git_sha false)

But that's the nuclear option, because -- if I understand it properly -- it's going to be injected as a build arg AND it'll be popped into the env vars for the containers (requiring a restarting all pods).

But what about if I only want to use the git sha as a build variable? I have a client that uses it to configure settings for some application integrations, and this lets the track what data comes from what version of their code they've deployed.
This means something like LAGOON_BUILD_NAME isn't going to work for them, since it's not explicitly tied to a version of the code deployed, just to the deployment (i.e. multiple deployments of the same exact code result in different LAGOON_BUILD_NAMEs)

Could we, perhaps, change the behaviour of this to allow the user to select the scope of the GIT_SHA?
Here https://docs.lagoon.sh/using-lagoon-the-basics/lagoon-yml/#environment_variablesgit_sha we say that if it's true it gets injected, but we could change that to also, say, take a scope (so, true/build/runtime/both).
This should be trivial to implement.

I'm keen to hear any ideas that let us achieve something similar - although this change to the GIT_SHA behaviour seems to be only a small tweak, that also brings it in line with how with think about env vars generally.

@bomoko bomoko linked a pull request Jun 8, 2023 that will close this issue
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 a pull request may close this issue.

1 participant