cdn_upload 497 B

1234567891011121314
  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/ -xzf build.tar.gz ./public/
  6. gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_STAG
  7. # Only upload to production CDN if branch is
  8. if [[ "$BRANCH_NAME" == "master" ]]; then
  9. gsutil -h "Cache-Control:public, max-age=31536000" -m cp -r /tmp/public $CDN_PROD
  10. fi
  11. fi