overleaf/services/web/bin/cdn_upload
Jakob Ackermann 2a8e2efe62 Merge pull request #2845 from overleaf/jpa-faster-web-ci
[misc] faster web ci

GitOrigin-RevId: bbd6b12040956f6b397c6ea4d8144e733299400b
2020-05-23 03:18:08 +00:00

14 lines
482 B
Bash
Executable file

#!/bin/bash
set -e
# Upload to staging CDN if branch is either 'master' or 'staging-master'
if [[ "$BRANCH_NAME" == "master" || "$BRANCH_NAME" == "staging-master" ]]; then
tar --directory=/tmp/ -xf build.tar
gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_STAG
# Only upload to production CDN if branch is
if [[ "$BRANCH_NAME" == "master" ]]; then
gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_PROD
fi
fi