Skip to content

Instantly share code, notes, and snippets.

@olblak
Created January 28, 2019 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olblak/53ea3269161bf5edfa44497eadce043f to your computer and use it in GitHub Desktop.
Save olblak/53ea3269161bf5edfa44497eadce043f to your computer and use it in GitHub Desktop.
file upload
#!/bin/bash
source /srv/releases/.azure-storage-env
## Sync files from "/srv/releases/jenkins/$CONTAINER" to $CONTAINER for each container in "$AZURE_STORAGE_ACCOUNT",
for CONTAINER in $(az storage container list --account-name "$AZURE_STORAGE_ACCOUNT" --account-key "$AZURE_STORAGE_KEY" --query '[*].name' --output table ); do
if [ -d "/srv/releases/jenkins/$CONTAINER" ]; then
echo "Syncing Container: $CONTAINER";
time blobxfer upload \
--local-path "/srv/releases/jenkins/$CONTAINER/" \
--storage-account-key "$AZURE_STORAGE_KEY" \
--storage-account "$AZURE_STORAGE_ACCOUNT" \
--remote-path $CONTAINER \
--recursive \
--skip-on-lmt-ge \
--connect-timeout 30 \
--exclude '.htaccess'
fi
done;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment