-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy.sh
executable file
·35 lines (31 loc) · 927 Bytes
/
deploy.sh
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
#!/bin/bash
# set -x # is a loud but handy in a pinch
set -eu -o pipefail
start_time=`date +%s`
if [ $# -eq 1 ] && [ "$1" = "full" ]
then
echo '>>> Building uberjar ...'
if lein uberjar
then
build_file="$(ls -rt target | grep standalone)"
scp "target/$build_file" miro:dev/broquaint/target
else
echo '!!! Build failed, aborting.'
exit 1
fi
sleep 120
else
echo '>>> No "full" argument, skipping uberjar build ...'
fi
cd blog
if bash deploy-site.sh
then
cd ..
echo '>>> Syncing JS/CSS files ...'
rsync -av resources/public/js resources/public/css miro:dev/broquaint/resources/public/
echo -n '<<< All done, '
perl -E 'my($then, $now) = @ARGV; my $d=$now-$then; say sprintf qq[only took%s %d seconds.], ($d > 60 ? " ${\int($d/60)} minutes and" : ""), $d%60' "$start_time" `date +%s`
else
echo '!!! Blog build failed, aborting.'
exit 1
fi