Skip to content

Commit 31a2252

Browse files
dphulkar-msftgapra-msft
authored andcommitted
Fix preview release handling for docker github and repo publish (#3084)
1 parent 3c125c0 commit 31a2252

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

build-1es-pipeline.yaml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -920,40 +920,43 @@ extends:
920920

921921
- script: |
922922
mv azcopy_linux_amd64 azcopy
923+
# (~) to be replaced by (-) if azcopy version contains a tilde as this is not supported in docker image tags
924+
azcopy_docker_version=$(echo $(azcopy_version) | sed 's/~/-/')
925+
echo "##vso[task.setvariable variable=azcopy_docker_version]$azcopy_docker_version"
923926
displayName: 'Setup AzCopy in expected location'
924927
925928
- task: 1ES.BuildContainerImage@1
926929
inputs:
927-
image: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-x86_64.$(azcopy_version):latest
930+
image: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-x86_64.$(azcopy_docker_version):latest
928931
path: '$(System.DefaultWorkingDirectory)'
929932
dockerfile: docker/Dockerfile
930933

931934
- task: 1ES.PushContainerImage@1
932935
inputs:
933-
image: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-x86_64.$(azcopy_version):latest
934-
remoteImage: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-x86_64.$(azcopy_version):latest
936+
image: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-x86_64.$(azcopy_docker_version):latest
937+
remoteImage: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-x86_64.$(azcopy_docker_version):latest
935938

936939
- task: 1ES.BuildContainerImage@1
937940
inputs:
938-
image: azcopycontainers.azurecr.io/azure-azcopy-mariner-x86_64.$(azcopy_version):latest
941+
image: azcopycontainers.azurecr.io/azure-azcopy-mariner-x86_64.$(azcopy_docker_version):latest
939942
path: '$(System.DefaultWorkingDirectory)'
940943
dockerfile: docker/DockerfileMariner
941944

942945
- task: 1ES.PushContainerImage@1
943946
inputs:
944-
image: azcopycontainers.azurecr.io/azure-azcopy-mariner-x86_64.$(azcopy_version):latest
945-
remoteImage: azcopycontainers.azurecr.io/azure-azcopy-mariner-x86_64.$(azcopy_version):latest
947+
image: azcopycontainers.azurecr.io/azure-azcopy-mariner-x86_64.$(azcopy_docker_version):latest
948+
remoteImage: azcopycontainers.azurecr.io/azure-azcopy-mariner-x86_64.$(azcopy_docker_version):latest
946949

947950
- task: 1ES.BuildContainerImage@1
948951
inputs:
949-
image: azcopycontainers.azurecr.io/azure-azcopy-mariner-arm64.$(azcopy_version):latest
952+
image: azcopycontainers.azurecr.io/azure-azcopy-mariner-arm64.$(azcopy_docker_version):latest
950953
path: '$(System.DefaultWorkingDirectory)'
951954
dockerfile: docker/DockerfileMarinerArm64
952955

953956
- task: 1ES.PushContainerImage@1
954957
inputs:
955-
image: azcopycontainers.azurecr.io/azure-azcopy-mariner-arm64.$(azcopy_version):latest
956-
remoteImage: azcopycontainers.azurecr.io/azure-azcopy-mariner-arm64.$(azcopy_version):latest
958+
image: azcopycontainers.azurecr.io/azure-azcopy-mariner-arm64.$(azcopy_docker_version):latest
959+
remoteImage: azcopycontainers.azurecr.io/azure-azcopy-mariner-arm64.$(azcopy_docker_version):latest
957960

958961
- job: LinuxARM64
959962
pool:
@@ -981,18 +984,21 @@ extends:
981984

982985
- script: |
983986
mv azcopy_linux_arm64 azcopy
987+
# (~) to be replaced by (-) if azcopy version contains a tilde as this is not supported in docker image tags
988+
azcopy_docker_version=$(echo $(azcopy_version) | sed 's/~/-/')
989+
echo "##vso[task.setvariable variable=azcopy_docker_version]$azcopy_docker_version"
984990
displayName: 'Setup AzCopy in expected location'
985991
986992
- task: 1ES.BuildContainerImage@1
987993
inputs:
988-
image: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-arm64.$(azcopy_version):latest
994+
image: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-arm64.$(azcopy_docker_version):latest
989995
path: '$(System.DefaultWorkingDirectory)'
990996
dockerfile: docker/Dockerfile
991997

992998
- task: 1ES.PushContainerImage@1
993999
inputs:
994-
image: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-arm64.$(azcopy_version):latest
995-
remoteImage: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-arm64.$(azcopy_version):latest
1000+
image: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-arm64.$(azcopy_docker_version):latest
1001+
remoteImage: azcopycontainers.azurecr.io/azure-azcopy-ubuntu-arm64.$(azcopy_docker_version):latest
9961002

9971003
- ${{ if eq(parameters.post_release, true) }}:
9981004
- stage: ReleaseToGithub
@@ -1013,6 +1019,9 @@ extends:
10131019

10141020
- script: |
10151021
echo "v$(azcopy_version)"
1022+
# (~) to be replaced by (-) if azcopy version contains a tilde as this is not supported in github tags
1023+
azcopy_github_tag=$(echo $(azcopy_version) | sed 's/~/-/')
1024+
echo "##vso[task.setvariable variable=azcopy_github_tag]$azcopy_github_tag"
10161025
displayName: 'AzCopy Tag Name'
10171026
10181027
- task: GithubRelease@1
@@ -1023,7 +1032,7 @@ extends:
10231032
target: '$(Build.SourceVersion)'
10241033
tagSource: 'userSpecifiedTag'
10251034
title: "AzCopy v$(azcopy_version)"
1026-
tag: "v$(azcopy_version)"
1035+
tag: "v$(azcopy_github_tag)"
10271036
changeLogCompareToRelease: 'lastFullRelease'
10281037
changeLogType: 'commitBased'
10291038
isDraft: ${{ parameters.draft }}
@@ -1150,7 +1159,7 @@ extends:
11501159
is_preview="true"
11511160
echo "##vso[task.setvariable variable=is_preview]$is_preview"
11521161
fi
1153-
1162+
11541163
while IFS=, read -r distro archetype repoName releaseName; do
11551164
# If the package is preview, publish to mariner preview package
11561165
if [[ $distro == *"Mariner-"* ]]; then
@@ -1171,7 +1180,7 @@ extends:
11711180
echo "Skipping for ARM type on $distro"
11721181
else
11731182
if [[ $distro == *"Mariner-"* ]]; then
1174-
if [ "$is_preview" = "true" ]; then
1183+
if [ "$(is_preview)" = "true" ]; then
11751184
repoName=$(echo $repoName | sed 's/prod/preview/')
11761185
fi
11771186
fi

docker/DockerfileMarinerArm64

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Create container based on mariner 2.0 image
2-
FROM --platform=linux/arm64 mcr.microsoft.com/cbl-mariner/base/core:2.0
3-
4-
# Install dependencies
5-
RUN tdnf update -y
6-
RUN tdnf install -y ca-certificates
2+
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0
73

84
# Copy azcopy binary to executable path
95
COPY ./azcopy /usr/local/bin/

0 commit comments

Comments
 (0)