Debian Codegraph @

contrib/cronjob.weekly

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/weekly.sh
11 . $TOPDIR/common.sh
12
13 BUILDLOCK=$HOME/.debian-cd.lock
14
15 # Make sure the machine isn't rebooted while we're busy
16 reboot_lock
17
18 # Uncomment the following to use daily d-i builds for these images
19 # rather than what's in the archive
20 USE_DAILY_DI=Y
21
22 if [ "$RELEASE_BUILD"x = ""x ] ; then
23 export RSYNC_TARGET=${OUT_BASE}/weekly-builds
24 else
25 export RSYNC_TARGET=${OUT_BASE}/.${RELEASE_BUILD}/debian-cd
26 export CONF=~/build.${CODENAME}/CONF.sh.${RELEASE_BUILD}
27 export RELEASE_BUILD=$RELEASE_BUILD
28 # If we're doing a normal set of daily/weekly builds, leave the
29 # checksum filenames alone. Otherwise, make life easier for people
30 # combining things later and append a suitable name as we build.
31 export EXTENSION=".large"
32 USE_DAILY_DI=N
33 NOSNAP=1
34 fi
35
36 export DI=trixie
37 export DI_DIST=${DI_DIST:-$DI}
38 export DI_CODENAME=${DI_CODENAME:-$DI}
39 export DRYRUN=$DRYRUN
40
41 if [ "$USE_DAILY_DI"x = "Y"x ] ; then
42 export DI=sid
43 export DI_DIST=$DI
44 export DI_CODENAME=$DI
45 export DI_WWW_HOME=default
46 export DI_DIR="$ARCH_DI_DIR"
47 else
48 unset DI_WWW_HOME
49 fi
50
51 export OUT_FREE_SID=${PUBDIRJIG}
52 export OUT_FREE_TST=${PUBDIRJIG}
53 export SUDO_USER=${SUDO_USER}
54
55 #export NOEDU=1
56
57 if [ "$PARALLEL"x = ""x ]; then
58 case $(hostname) in
59 casulana)
60 PARALLEL=20;;
61 *)
62 echo "Not running build on $(hostname)"
63 exit 1
64 ;;
65 esac
66 fi
67
68 # Export these so they'll affect Makefile behaviour too
69 export NOLIVE NOINST NOEDU NOFW NOSNAP
70
71 if lockfile -r0 $BUILDLOCK ; then
72
73 cd $TOPDIR
74
75 # Do the builds in parallel
76 NUM_BUILDS=0
77 if [ "$TARGETS"x = ""x ]; then
78 # Work out what builds we need automatically
79 if [ "$NOFW"x = ""x ]; then
80 TARGETS="$TARGETS all_firmware"
81 NUM_FW=$(make -f Makefile.weekly count_fw)
82 NUM_BUILDS=$(($NUM_BUILDS + $NUM_FW))
83 fi
84 if [ "$NOINST"x = ""x ]; then
85 TARGETS="$TARGETS all_inst"
86 NUM_INST=$(make -f Makefile.weekly count_inst)
87 NUM_BUILDS=$(($NUM_BUILDS + $NUM_INST))
88 fi
89 if [ "$NOLIVE"x = ""x ]; then
90 TARGETS="$TARGETS all_live"
91 NUM_LIVE=$(make -f Makefile.weekly count_live)
92 NUM_BUILDS=$(($NUM_BUILDS + $NUM_LIVE))
93 fi
94 else
95 echo "Using specified builds $TARGETS"
96 NUM_BUILDS="N"
97 fi
98 echo "$NUM_BUILDS build(s) to run, trying up to $PARALLEL in parallel"
99 make -f Makefile.weekly clean_builds_log
100 make -f Makefile.weekly -j $PARALLEL $TARGETS NUM_BUILDS=$NUM_BUILDS
101
102 if [ "$NOINST"x = ""x ]; then
103 rsync_to_umu ${OUT_BASE}/cd-sources/ cd-sources/
104 publish_at_umu cd-sources
105
106 if [ "$NOSNAP"x = ""x ] ; then
107 mkdir -p /tmp/snapshots
108 rsync_to_umu /tmp/snapshots/ snapshots/
109 publish_at_umu snapshots
110 rmdir /tmp/snapshots/
111 fi
112
113 for DIR in $RSYNC_TARGET; do
114 date -u > $DIR/trace/cdimage.debian.org
115 PETOUT=${DIR##${OUT_BASE}/}
116 rsync_to_umu $DIR/trace/ ${PETOUT}/trace/
117 publish_at_umu ${PETOUT}/trace
118 done
119
120 fi
121 rm -f $BUILDLOCK
122 fi