Jun 16 2021
07:10 AM
- last edited on
Mar 05 2024
01:12 PM
by
TechCommunityAP
Jun 16 2021
07:10 AM
- last edited on
Mar 05 2024
01:12 PM
by
TechCommunityAP
We have a devops setup where when we set a new tag in Azure Repos, it sets off a docker image build in Azure pipelines and passes the image over to Docker Hub. I have been asked to automate the final part which then automatically loads the latest version of the image to a test environment, which I have achieved using a webhook and setting the pipeline to build and push 2 versions of the app, one with the version number set in the Repo tag and another always set to 'latest'. Then, when the latest image is pushed, dockerhub calls the webhook and the test environment will pull down the latest version of this latest tag and load it to a container. So far so good. What I want to do now is when the image is being built in the pipeline, I want to replace the ENV APP_VERSION which we have set in the Dockerfile with a hardcoded value with the $tag set in Repo, this way we will know from the front end which image build we are running. This $tag is already being used when pushed to dockerhub, I just want to utilise it further so from the front end we know which version of docker image is running (as certain developers do not have access to the backend to see the docker setup). Anyone have any ideas on how to achieve this?
Jun 16 2021 09:50 AM