diff --git a/bin/deploy-aws b/bin/deploy-aws index 777cde624e1b4f427a871c6217df6cfe4ca06d57..252ca57e2bc5d4281059f8e1fd239c818b24ee52 100755 --- a/bin/deploy-aws +++ b/bin/deploy-aws @@ -7,17 +7,16 @@ set -u; # get current branch from git info PROJECT=${CI_PROJECT_NAME}; -BRANCH=${CI_COMMIT_REF_NAME}; +BRANCH=$(echo "${CI_COMMIT_REF_NAME}" | cut -d'.' -f1-2); # first two parts, if tag name # set project base DEPLOY_PATH="web_guidelines/${PROJECT}/${BRANCH}"; if [ "${1:-''}" = "prod" ]; then S3_BUCKET=${S3_BUCKET_PROD}; - MAX_AGE=60; # 1min + MAX_AGE=$(cat .max-age); # define in .max-age else S3_BUCKET=${S3_BUCKET_DEV}; - MAX_AGE=60; # 1min fi; # push to AWS (exclude bin and .git) @@ -25,5 +24,5 @@ aws s3 sync . s3://${S3_BUCKET}/${DEPLOY_PATH} \ --exclude ".git*" \ --exclude "bin/*" \ --delete \ - --cache-control "max-age=${MAX_AGE}" \ + --cache-control "max-age=${MAX_AGE:-60}" \ ;