mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-08 11:42:38 +00:00
Merge pull request #2420 from overleaf/csh-issue-2504-cdn-upload
Script for CDN upload GitOrigin-RevId: f90a3b07178d8a231a2a7babac52bed3577065c1
This commit is contained in:
parent
26190da566
commit
9b59dcded9
1 changed files with 14 additions and 0 deletions
14
services/web/bin/cdn_upload
Executable file
14
services/web/bin/cdn_upload
Executable file
|
@ -0,0 +1,14 @@
|
|||
#!/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/ -xzf build.tar.gz ./public/
|
||||
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
|
||||
|
||||
|
Loading…
Reference in a new issue