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

Setting to enable/disable injecting of LAGOON_GIT_SHA into DeploymentConfig #841

Closed
Schnitzel opened this issue Jan 10, 2019 · 1 comment
Assignees

Comments

@Schnitzel
Copy link
Contributor

Currently we inject the GIT SHA of the current build into the deploymentconfig of many services:
https://github.com/amazeeio/lagoon/blob/master/images/oc-build-deploy-dind/openshift-templates/node/deployment.yml#L98-L99
https://github.com/amazeeio/lagoon/blob/master/images/oc-build-deploy-dind/openshift-templates/node-persistent/deployment.yml#L114-L115
https://github.com/amazeeio/lagoon/blob/master/images/oc-build-deploy-dind/openshift-templates/nginx/deployment.yml#L101-L102

This provides a nice feature that if the application code needs to access the Git Hash of the current build it has it accessible in an environment variable LAGOON_GIT_SHA.
Unfortunately though this also means that every deploymentconfig will redeploy it's containers even if the docker image itself has not changed. That can cause much longer deployments and even sometimes service interruptions where they would not be needed.

Therefore the idea is to somehow define within .lagoon.yml globally for all services or in docker-compose.yml per service if the application needs the LAGOON_GIT_SHA env variable and only if it is requested by the service actually inject it into the deploymentconfig.

It probably is possible to have the default to not inject it anymore as I don't think many applications today actually use LAGOON_GIT_SHA, definitely the lagoon internal tests are using it, but there we could just adapt the docker-compose.yml

@twardnw twardnw self-assigned this Feb 1, 2019
@twardnw
Copy link
Contributor

twardnw commented Feb 4, 2019

Ok, after discussion with Michael, we will have the git_sha injection disabled by default. We will add a project-level entry to the .lagoon.yml, which will then allow the git_sha to be injected into the deployment configs of services which need it.

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

No branches or pull requests

2 participants