#!/bin/bash USAGE=< "$S3CMD_CFG" cat $AWS_CONFIG_FILE | grep "aws_access_key_id" | sed "s/aws_access_key_id/access_key/" >> "$S3CMD_CFG" cat $AWS_CONFIG_FILE | grep "aws_secret_access_key" | sed "s/aws_secret_access_key/secret_key/" >> "$S3CMD_CFG" fi if grunt clean $BUILD_CMD; then echo "Preparing to upload to S3..." s3cmd sync -r -P --add-header="cache-control:max-age=1800" $SOURCE_DIR $TARGET_DIR echo "S3 Upload Complete" else echo "ERROR: Building distribution failed. Aborting deployment!" exit 1 fi