forked from andybarry/flight
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-all
executable file
·57 lines (41 loc) · 1.03 KB
/
build-all
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
#!/bin/bash
# make bash bail out if anything errors
set -e
set -o pipefail
# error out if the date is before the year 2014
# since that indicates the clock isn't set
if [ `date +%s` -lt 1430231759 ]
then
echo "Error: time/date is not set correctly."
echo "Current time/date: `date`"
exit 1
fi
echo "This is: $HOSTNAME"
# read the file
FILE=tobuild.txt
while read line; do
# ignore comments
case "$line" in \#*) continue ;; esac
# ignore empty lines
if [ -z $line ]
then
continue
fi
echo "-----------------------------"
echo " Building: $line"
echo "-----------------------------"
cd $line
# check for makefile
if [ -e Makefile ]
then
make "$@"
else
./build-all "$@"
fi
cd ..
done < $FILE
# write files that record date and git SHA of last successful build
SHA=`git rev-parse HEAD`
LAST_BUILD_DATE=`date +%s`
printf "SHA at last build: $SHA\nTimestmap of last build: $LAST_BUILD_DATE\n" > lastbuild.txt
echo "done with "`pwd`" on $HOSTNAME"