Skip to content

Instantly share code, notes, and snippets.

@TomDunn
TomDunn / .upload.sh
Created April 26, 2017 07:34
Upload zip to S3 from Bitbucket pipelines
BUCKET="!!!!!!!!YOUR_AMAZON_S3_BUCKET_NAME_HERE!!!!!!!!!!"
CONTENT_TYPE="application/zip"
DATE=`date -R`
IN_FILE="revision.zip"
KEY="demo/revision.zip"
RESOURCE="/${BUCKET}/${KEY}"
HMAC="PUT\n\n${CONTENT_TYPE}\n${DATE}\n${RESOURCE}"
zip -r --exclude=*.git* "$IN_FILE" .