Debian Codegraph @

contrib/cronjob.daily

raw
1 #!/bin/bash
2
3 TOPDIR=$(dirname $0)
4 if [ "$TOPDIR" = "." ] ; then
5 TOPDIR=`pwd`
6 fi
7 export TOPDIR
8
9 . $TOPDIR/settings.sh
10 . $TOPDIR/daily.sh
11 . $TOPDIR/common.sh
12
13 BUILDLOCK=$HOME/.debian-cd.lock
14 BUILDS_RUNNING=""
15
16 if [ "$RELEASE_BUILD"x = ""x ] ; then
17 export SID_WANTED=1
18 export OUT_FREE_SID=${PUBDIRJIG}/sid_d-i/${DATE_BUILD}
19 export RSYNC_TARGET_FREE=${OUT_BASE}/daily-builds
20 else
21 echo "Don't support release builds of dailies! Use cronjob.weekly instead"
22 exit 1
23 fi
24
25 export DI=sid
26 export DI_DIST=$DI
27 export DI_CODENAME=$DI
28 export DI_WWW_HOME=default
29 export DI_DIR="$ARCH_DI_DIR"
30
31 if [ "$PARALLEL"x = ""x ]; then
32 PARALLEL=20
33 fi
34
35 # Make sure the machine isn't rebooted while we're busy
36 reboot_lock
37
38 cd $TOPDIR &&
39 if lockfile -r0 $BUILDLOCK ; then
40
41 # echo "NOT checking for git updates"
42 echo "git update debian-cd"
43 cd debian-cd && git pull ; cd ..
44
45 cd $TOPDIR
46
47 # Do the build in parallel
48 make -f Makefile.daily -j $PARALLEL $TARGETS
49
50 if [ "$NOSYNC"x = ""x ] ; then
51 echo "Clean up old builds on build machine:"
52 for DIR in $PUBDIRJIG/* ; do
53 cd $DIR
54 for THIS in 20* ; do
55 if [ $THIS != $DATE-$BUILDNUM ] ; then
56 echo " Deleting $DIR/$THIS"
57 rm -rf $DIR/$THIS
58 fi
59 done
60 done
61
62 echo "Sync normal builds across to output dir: $RSYNC_TARGET_FREE"
63 rsync -rHlt $PUBDIRJIG/ $RSYNC_TARGET_FREE/
64
65 echo "Remove extra builds:"
66 ~/bin/remove_extra_dailies
67
68 echo "$DATE-$BUILDNUM" > $RSYNC_TARGET_FREE/daily-trace
69
70 case $(hostname) in
71 pettersson*)
72 ISO_OPTIONS='--exclude .iso-wanted'
73 ;;
74 *)
75 ISO_OPTIONS='--exclude *.iso'
76 ;;
77 esac
78
79 (cd ${RSYNC_TARGET_FREE}/sid_d-i/${DATE_BUILD} && find . -name '*.iso' > .iso-wanted)
80 rsync_to_umu ${RSYNC_TARGET_FREE}/sid_d-i/${DATE_BUILD}/ \
81 daily-builds/sid_d-i/${DATE_BUILD}/ \
82 "$ISO_OPTIONS"
83 publish_at_umu daily-builds/sid_d-i/${DATE_BUILD}
84
85 trigger_openqa daily-builds/sid_d-i/${DATE_BUILD} "$(debversion)" ${DATE_BUILD} amd64,arm64
86
87 rsync_to_umu ${OUT_BASE}/cd-sources/ cd-sources/
88 publish_at_umu cd-sources
89
90 fi
91
92 cd $TOPDIR
93 rm -f $BUILDLOCK
94 fi
95