Container Image Tagging Strategy On Pull Request vs. Individual CI
Usually, we have a QA environment before pushing an application update to production. Let’s see to handle the creation of a Docker image for each environment in Azure DevOps.
Let’s say you have:
a Python REST API and you uses Docker to containerize it.
two environments (Production and QA) on Azure Cloud Services.
a DevOps pipeline that builds and push the Docker image to a Container Registry on Azure and tag the latest image with latest tag.
Next, you have a DevOps branch policy to trigger a build pipeline on:
an Individual CI trigger when something is pushed to
main.a Pull Request (PR) trigger where you want to merge into
main.
With the above, the result is that DevOps creates an image tagged latest on both triggers.
Wouldn’t it be better to distinguish the two builds and be able to test the PR build on the QA environment?
Yes, it would.
Here is how to modify the pipeline ➡️ in the full article ⬅️
Originally published on iamjeremie.me


