For several environments, I need to have different docker image tagging policies, that is: dev and release should utilize 'Latest' tag, while production should have proper version tag.
I am currently using single Yaml file for all AzureDevOps Build Pipeline, and want to have image tagging mode to be defined as Variable per build /lets say called $(Versioned)/.
The build step is shown below:
steps - bash: docker push $(imageFullName):latest displayName: 'docker push'
So is there any way to have IF statement or other conditional operation here. For example:
steps - bash: docker push $(imageFullName):IF($(Versioned), $(Build.BuildNumber), latest) displayName: 'docker push'