From ce366ecbaae79eb6f53a8584ce9bb66404084742 Mon Sep 17 00:00:00 2001 From: cccs-jc Date: Wed, 10 Mar 2021 15:52:46 +0000 Subject: [PATCH 1/3] docker image tag --- azure-pipelines.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9061c30878ad5..41ecffd53da2d 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,6 +17,7 @@ variables: containerRegistry: 'uchimera.azurecr.io' dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile' tag: '$(Build.BuildId)' + buildTimestamp: $[format('{0:yyyyMMddHHmmss}', pipeline.startTime)] # Agent VM image name vmImageName: 'ubuntu-latest' @@ -32,6 +33,9 @@ stages: steps: - checkout: self + - bash: | + BRANCH_NAME=`echo "$SYSTEM_PULLREQUEST_SOURCEBRANCH $BUILD_SOURCEBRANCH" | sed -r 's/^\s*(refs\/heads\/)?(\S*).*$/\2/' | sed 's/\//_/g'` + echo "##vso[task.setvariable variable=BRANCH_NAME]$BRANCH_NAME" - task: Docker@2 displayName: Build and push an image to container registry @@ -41,5 +45,6 @@ stages: dockerfile: $(dockerfilePath) containerRegistry: $(dockerRegistryServiceConnection) tags: | - latest + $(BRANCH_NAME) + $(BRANCH_NAME)_$(buildTimestamp)_b$(Build.BuildId) From b2bbb6c8b70b145d19cdedb91625adc0b976583f Mon Sep 17 00:00:00 2001 From: cccs-jc Date: Wed, 10 Mar 2021 18:26:14 +0000 Subject: [PATCH 2/3] added latest tag --- azure-pipelines.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 41ecffd53da2d..a65bd280378c7 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,4 +47,5 @@ stages: tags: | $(BRANCH_NAME) $(BRANCH_NAME)_$(buildTimestamp)_b$(Build.BuildId) + latest From 3640c5a9eae3d7028f7a7924e0a75564e05976fc Mon Sep 17 00:00:00 2001 From: cccs-jc Date: Wed, 10 Mar 2021 21:31:57 +0000 Subject: [PATCH 3/3] removed latest --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a65bd280378c7..06d04a0644264 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -47,5 +47,5 @@ stages: tags: | $(BRANCH_NAME) $(BRANCH_NAME)_$(buildTimestamp)_b$(Build.BuildId) - latest +