Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add overwrite flag to az storage upload #715

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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