Skip to content

Commit

Permalink
ci: add overwrite flag to az storage upload
Browse files Browse the repository at this point in the history
The storage command of azure cli needs an overwrite flag set to true
since v2.34.0

see Azure/azure-cli#21477
  • Loading branch information
phiz71 committed Mar 9, 2022
1 parent 02538e9 commit e8d090b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ jobs:

deploy-on-azure-storage:
docker:
- image: mcr.microsoft.com/azure-cli:latest
# Version can be found here https://docs.microsoft.com/en-us/cli/azure/release-notes-azure-cli
# be careful when updating the version as it looks it is not following semver
- image: mcr.microsoft.com/azure-cli:2.34.1
resource_class: small
steps:
- attach_workspace:
Expand All @@ -53,8 +55,12 @@ jobs:
name: Login into Azure Storage and upload dist
command: |
az login --service-principal -u $AZURE_APPLICATION_ID --tenant $AZURE_TENANT -p $AZURE_APPLICATION_SECRET
az storage container create -n $BRANCH_ID --public-access blob
az storage blob upload-batch -s _site -d $BRANCH_ID
CONTAINER_EXISTS=$(az storage container exists -n $BRANCH_ID | jq .exists)
if [ "$CONTAINER_EXISTS" = false ] ; then
echo "Creating container $BRANCH_ID"
az storage container create -n $BRANCH_ID --public-access blob
fi
az storage blob upload-batch -s _site -d $BRANCH_ID --overwrite true
comment-pr-after-deployment:
docker:
Expand Down

0 comments on commit e8d090b

Please sign in to comment.