-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathinstall-deps
executable file
·44 lines (34 loc) · 1.2 KB
/
install-deps
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
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
cd /deps
## Update with the latest cpanfile and cpanfile.snapshot files
## This allows you to keep updating the local docker enviroment
## during development, just run this script again
if [ -z "$SKIP_REFRESH" -a -e /app/cpanfile ] ; then
echo "... refreshing cpanfile* from app"
rm cpanfile*
cp /app/cpanfile* .
fi
## Install the deps, and hopefuly all will work out
carton install --deployment 2>&1 | tee .carton.log
if [ $? == 0 ] ; then
rm -rf ./local/cache "$HOME/.cpanm" .carton.log
## We make sure all is owned by app so that we can run it again later, during
## development
chown -R app:app .
exit 0
fi
## Ok, carton install failed, run it again with logs and dump a summary of the
## relevant parts
carton install --deployment
if [ $? != 0 ] ; then
echo "***** BEGIN original carton install log (without the 'Successfully installed' lines)"
egrep -v "^Successfully installed " .carton.log | grep -v "/bin/tar: Ignoring unknown extended header keyword"
echo "******"
echo "***** BEGIN build.log"
cat $HOME/.cpanm/build.log
echo "******"
echo "****** carton install failed, search log backwards until 'BEGIN original' and debug it"
echo "******"
exit 1
fi