Skip to content

Commit 4b0afc2

Browse files
Fix build version
1 parent 2a1cdbf commit 4b0afc2

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

azure-pipelines.yml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ resources:
1010

1111
variables:
1212
- group: camera-onboarding-variable-group
13+
buildVersion: $[format('{0:yyyyMMdd}-{1}', pipeline.startTime, variables['Build.SourceVersion'])]
1314

1415
stages:
1516
- stage: Build
@@ -44,14 +45,6 @@ stages:
4445
command: login
4546
containerRegistry: $(DOCKER_REGISTRY_CONNECTION)
4647

47-
- script: |
48-
echo "Setting BUILD_VERSION..."
49-
set BUILD_VERSION=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%-%BUILD_SOURCEVERSION:~0,7%
50-
echo BUILD_VERSION=%BUILD_VERSION%
51-
echo "##vso[task.setvariable variable=BUILD_VERSION;isOutput=true]%BUILD_VERSION%"
52-
echo "::add-mask::%BUILD_VERSION%"
53-
displayName: "Set Secret Build Version"
54-
5548
- task: Docker@2
5649
displayName: Build Docker Image
5750
inputs:
@@ -60,13 +53,13 @@ stages:
6053
dockerfile: $(DOCKERFILE_PATH)
6154
arguments: "--platform linux/amd64"
6255
tags: |
63-
$(BUILD_VERSION)
56+
$(buildVersion)
6457
6558
- task: Docker@2
6659
displayName: Push Docker Image
6760
inputs:
6861
command: push
6962
repository: $(IMAGE_REPOSITORY)
7063
tags: |
71-
$(BUILD_VERSION)
64+
$(buildVersion)
7265

0 commit comments

Comments
 (0)