cdn_upload 551 B

123456789101112131415161718
  1. #!/bin/bash
  2. set -e
  3. # Upload to staging CDN if branch is either 'master' or 'staging-master'
  4. if [[ "$BRANCH_NAME" == "master" || "$BRANCH_NAME" == "staging-master" ]]; then
  5. tar --directory=/tmp/ -xf build.tar
  6. # delete source maps
  7. find /tmp/public -name '*.js.map' -delete
  8. gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_STAG
  9. # Only upload to production CDN if branch is
  10. if [[ "$BRANCH_NAME" == "master" ]]; then
  11. gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_PROD
  12. fi
  13. fi