@@ -52,6 +52,8 @@ stages:
5252 displayName: "Set up the Go environment"
5353
5454 - script : |
55+ BUILD_NUMBER=$(Build.BuildNumber)
56+ echo "##vso[task.setvariable variable=StorageID;isOutput=true]$(echo ${BUILD_NUMBER//./-})"
5557 echo "##vso[task.setvariable variable=CommitHash;isOutput=true]$(git rev-parse HEAD)"
5658 echo "##vso[task.setvariable variable=Tag;isOutput=true]$(git describe --tags --always --dirty)"
5759 export BRANCH=$(Build.SourceBranchName)
@@ -168,9 +170,9 @@ stages:
168170 azureSubscription : $(ARTIFACT_SUBSCRIPTION)
169171 scriptLocation : " inlineScript"
170172 inlineScript : |
171- echo Creating storage container with name acn-$(EnvironmentalVariables.CommitHash ) and account name $(STORAGE_ACCOUNT_NAME)
172- az storage container create -n acn-$(EnvironmentalVariables.CommitHash ) --account-name $(STORAGE_ACCOUNT_NAME) --public-access container
173- az storage blob upload-batch -d acn-$(EnvironmentalVariables.CommitHash ) -s ./output/ --account-name $(STORAGE_ACCOUNT_NAME)
173+ echo Creating storage container with name acn-$(EnvironmentalVariables.StorageID ) and account name $(STORAGE_ACCOUNT_NAME)
174+ az storage container create -n acn-$(EnvironmentalVariables.StorageID ) --account-name $(STORAGE_ACCOUNT_NAME) --public-access container
175+ az storage blob upload-batch -d acn-$(EnvironmentalVariables.StorageID ) -s ./output/ --account-name $(STORAGE_ACCOUNT_NAME)
174176 workingDirectory : " $(modulePath)"
175177 displayName : Create artifact storage container
176178 condition : succeeded()
@@ -226,8 +228,9 @@ stages:
226228 azureSubscription : $(ARTIFACT_SUBSCRIPTION)
227229 scriptLocation : " inlineScript"
228230 inlineScript : |
229- export CommitHash=$(git rev-parse HEAD)
230- echo Deleting storage container with name acn-$CommitHash and account name $(STORAGE_ACCOUNT_NAME)
231- az storage container delete -n acn-$CommitHash --account-name $(STORAGE_ACCOUNT_NAME)
231+ BUILD_NUMBER=$(Build.BuildNumber)
232+ BUILD_NUMBER=${BUILD_NUMBER//./-}
233+ echo Deleting storage container with name acn-$BUILD_NUMBER and account name $(STORAGE_ACCOUNT_NAME)
234+ az storage container delete -n acn-$BUILD_NUMBER --account-name $(STORAGE_ACCOUNT_NAME)
232235 workingDirectory : " $(modulePath)"
233236 displayName : Cleanup remote Azure storage container
0 commit comments