-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·25 lines (20 loc) · 1.41 KB
/
deploy.sh
File metadata and controls
executable file
·25 lines (20 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# This script can be used to deploy Galapagos to a non-standard AWS location
# AWS credentials will need to be configured for this script to work. See the
# AWS command line tools docs for how to do that.
# Usage (from root of the Galapgos repo):
# ./scripts/deploy.sh s3-target-bucket/target-folder DISTRIBUTION_ID url/path
# Example deploying to experiments site in subfolder /nettango/:
# ./scripts/deploy.sh netlogo-web-experiments-content/nettango E2TDYOH5TZH83M experiments.netlogoweb.org/nettango
# For reference, if there is an emergency, these commands can be run to deploy
# to staging or production in the situation where Jenkins is down or otherwise
# cannot be used to deploy.
# ./scripts/deploy.sh netlogo-web-staging-content E360I3EFLPUZR0 staging.netlogoweb.org
# ./scripts/deploy.sh netlogo-web-prod-content E3AIHWIXSMPCAI netlogoweb.org
sbt "set scrapeAbsoluteURL := Some(\"$3\")" clean bundle scrapePlay
cp -Rv public/modelslib/ target/play-scrape/assets/
cp -Rv public/nt-modelslib/ target/play-scrape/assets/
cp -Rv public/versions/ target/play-scrape/
aws s3 sync ./target/play-scrape s3://$1 --delete --acl public-read --exclude "*" --include "*.*" --exclude "*.html"
aws s3 sync ./target/play-scrape s3://$1 --delete --acl public-read --exclude "*" --include "*[!.]*" --include "*.html" --content-type "text/html; charset=utf-8"
aws cloudfront create-invalidation --distribution-id $2 --paths "/*"