Only try to cache dependencies when Amazon secret is available

Fixes the case when someone forks the repo and runs Travis on their own.
Also, allows the use-case of restoring dependencies only without
necessarily trying to cache them.
This commit is contained in:
Mislav Marohnić 2014-02-12 00:48:57 +01:00
parent b5ea93a0cc
commit 62a5781b92

View File

@ -39,7 +39,7 @@ fi
bundle "$@"
if [ ! -f "$cache_name" ]; then
if [ ! -f "$cache_name" ] && [ -n "$AMAZON_SECRET_ACCESS_KEY" ]; then
echo "Caching \`${bundle_path}' to S3"
tar czf "$cache_name" "$bundle_path"
script/s3-put "$cache_name" "${AMAZON_S3_BUCKET}:${TRAVIS_REPO_SLUG}/${cache_name}"