2019-12-02 07:17:23 -05:00
|
|
|
#!/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
|
2020-05-22 06:34:57 -04:00
|
|
|
tar --directory=/tmp/ -xf build.tar
|
2020-07-02 11:51:38 -04:00
|
|
|
|
|
|
|
# delete source maps
|
|
|
|
find /tmp/public -name '*.js.map' -delete
|
|
|
|
|
2019-12-02 07:17:23 -05:00
|
|
|
gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_STAG
|
2020-05-22 06:34:57 -04:00
|
|
|
# Only upload to production CDN if branch is
|
2019-12-02 07:17:23 -05:00
|
|
|
if [[ "$BRANCH_NAME" == "master" ]]; then
|
|
|
|
gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_PROD
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|