-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy
executable file
·36 lines (29 loc) · 1.02 KB
/
deploy
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
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
set -o errexit
ENVIRONMENT=${1:-"development"}
deploy_dir="/srv/web/apps/vivo_widgets_reporter"
case "$ENVIRONMENT" in
development)
SERVERS=("scholars-web-dev-02.oit.duke.edu")
;;
acceptance)
SERVERS=("scholars-web-test-04.oit.duke.edu" "scholars-web-test-05.oit.duke.edu")
;;
production)
SERVERS=("scholars-web-04.oit.duke.edu" "scholars-web-05.oit.duke.edu")
;;
*)
echo "Usage: $0 {development|acceptance|production}"
exit 1
esac
lein cljsbuild once production
for SERVER in "${SERVERS[@]}"; do
echo "deploying to $ENVIRONMENT server: $SERVER..."
echo "rsyncing files to $SERVER..."
rsync -avz production.html tomcat@$SERVER:$deploy_dir/scholar_report.html
echo "creating asset directory on $SERVER..."
ssh tomcat@$SERVER "[ -d $deploy_dir/assets ] || mkdir $deploy_dir/assets"
echo "rsyncing asset files to $SERVER..."
rsync -avz assets/css/*.css tomcat@$SERVER:$deploy_dir/assets/css/
rsync -avz assets/js/*.js tomcat@$SERVER:$deploy_dir/assets/js/
done