forked from Incubaid/arakoon
-
Notifications
You must be signed in to change notification settings - Fork 7
/
travis.sh
executable file
·71 lines (51 loc) · 1 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash -xue
OUTPUT=temp_file.txt
timeout_with_progress () (
set +x
timeout "$@" > $OUTPUT 2>&1 &
PID=$!
echo $PID
while kill -0 $PID 2>/dev/null
do
echo -ne .
sleep 1
done
wait $PID
RESULT=$?
tail -n512 $OUTPUT
return $RESULT
)
install () {
echo "Running 'install' phase"
date
START_BUILD=$(date +%s.%N)
echo $START_BUILD
timeout_with_progress 9000 ./docker/run.sh ubuntu-16.04 clean
END_BUILD=$(date +%s.%N)
echo "build stopped after $END_BUILD"
}
script () {
echo "Running 'script' phase"
date
timeout_with_progress 9000 ./docker/run.sh ubuntu-16.04 unit
date
}
after_failure () {
echo "Something went wrong"
url= `cat temp_file.txt | nc termbin.com 9999`
echo $url
}
case "${1-undefined}" in
install)
install
;;
script)
script
;;
after_failure)
after_failure
;;
*)
echo "Usage: $0 {install|script}"
exit 1
esac