README.md in capistrano-s3-copy-0.0.3 vs README.md in capistrano-s3-copy-0.0.4
- old
+ new
@@ -59,18 +59,32 @@
cap deploy
Of course, everyone has tweaks that they make to the standard capistrano recipe. For this reason, the script
thats executed is generated from an ERB template.
+
#!/bin/sh
# Auto-scaling capistrano like deployment script Rails3 specific.
+ set -x
+ set -e
+
echo "AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}"
echo "AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}"
- AWS_RELEASES_BUCKET=<%= configuration[:aws_releases_bucket] %>
+ if [ "${AWS_ACCESS_KEY_ID}" == "" ]; then
+ echo "Expecting the environment variable AWS_ACCESS_KEY_ID to be set"
+ exit 1
+ fi
+
+ if [ "${AWS_SECRET_ACCESS_KEY}" == "" ]; then
+ echo "Expecting the environment variable AWS_SECRET_ACCESS_KEY to be set"
+ exit 2
+ fi
+
+ AWS_RELEASES_BUCKET=<%= configuration[:aws_releases_bucket] %>
RAILS_ENV=<%= configuration[:rails_env] %> # e.g. production
DEPLOY_TO=<%= configuration[:deploy_to] %> # e.g. /u/apps/myapp
RELEASES_PATH=<%= configuration[:releases_path] %> # e.g. /u/apps/myapp/releases
RELEASE_PATH=<%= configuration[:release_path] %> # e.g. /u/apps/myapp/releases/20120428210958
SHARED_PATH=<%= configuration[:shared_path] %> # e.g. /u/apps/myapp/shared
@@ -96,10 +110,10 @@
# Project specific shared directories
# mkdir -p ${SHARED_PATH}/content
# mkdir -p ${SHARED_PATH}/uploads
# cap deploy:update_code
- s3cmd get ${AWS_RELEASE_BUCKET}:${S3_PACKAGE_PATH} ${DOWNLOADED_PACKAGE_PATH} 2>&1
+ s3cmd get ${AWS_RELEASES_BUCKET}:${S3_PACKAGE_PATH} ${DOWNLOADED_PACKAGE_PATH} 2>&1
cd ${RELEASES_PATH} && ${DECOMPRESS_CMD} && rm ${DOWNLOADED_PACKAGE_PATH}
# cap deploy:assets_symlink (Rails 3.x specific)
rm -rf ${RELEASE_PATH}/public/assets
mkdir -p ${RELEASE_PATH}/public