-
Notifications
You must be signed in to change notification settings - Fork 10
/
travis.sh
executable file
·54 lines (41 loc) · 1.03 KB
/
travis.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash -xue
install () {
echo "Running 'install' phase"
date
env | sort
# if [[ -e ~/cache/image.tar.gz ]];
# then docker load -i ~/cache/image.tar.gz; fi
# START_BUILD=$(date +%s.%N)
# echo $START_BUILD
./run_with_timeout_and_progress.sh 9000 ./docker/run.sh $IMAGE clean
# END_BUILD=$(date +%s.%N)
# echo $END_BUILD
# DIFF=$(echo "$END_BUILD - $START_BUILD" | bc)
# if [ $DIFF \> 5 ]
# then
# df -h
# mkdir ~/cache || true
# rm -f ~/cache/image.tar.gz
# docker save -o ~/cache/image.tar.gz alba_ubuntu-16.04
# ls -ahl ~/cache;
# else
# echo Building of container took only $DIFF seconds, not updating cache this time;
# fi
}
script () {
echo "Running 'script' phase"
date
./run_with_timeout_and_progress.sh 9000 ./docker/run.sh $IMAGE $SUITE
date
}
case "$1" in
install)
install
;;
script)
script
;;
*)
echo "Usage: $0 {install|script}"
exit 1
esac