summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2020-03-25 22:41:04 +0000
committerPascal Terjan <pterjan@mageia.org>2020-03-25 22:41:18 +0000
commitb48fc78d6d067d8ece912ef2c7558d2e44f361de (patch)
tree678ef3ba1e509eeb19b7bef33729bd4019241239
parent0555e68c7c783e608eb36ad18558b43c5e1daf2c (diff)
downloadautobuild-b48fc78d6d067d8ece912ef2c7558d2e44f361de.tar
autobuild-b48fc78d6d067d8ece912ef2c7558d2e44f361de.tar.gz
autobuild-b48fc78d6d067d8ece912ef2c7558d2e44f361de.tar.bz2
autobuild-b48fc78d6d067d8ece912ef2c7558d2e44f361de.tar.xz
autobuild-b48fc78d6d067d8ece912ef2c7558d2e44f361de.zip
Update to currently used scripts
-rwxr-xr-xfetch-autobuild.sh31
-rwxr-xr-xnewbuild.sh6
-rwxr-xr-xrebuild.sh36
3 files changed, 61 insertions, 12 deletions
diff --git a/fetch-autobuild.sh b/fetch-autobuild.sh
new file mode 100755
index 0000000..82a5a3f
--- /dev/null
+++ b/fetch-autobuild.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+IN_PROGRESS=$(ssh -o ConnectTimeout=10 autobuild cat /home/iurt/autobuild-logs/IN-PROGRESS 2>/dev/null)
+
+if [ -n "$IN_PROGRESS" ]; then
+ rsync -qa autobuild:/home/iurt/autobuild-logs/${IN_PROGRESS}/log/ /var/www/bs/autobuild/cauldron/aarch64/core/${IN_PROGRESS}/
+else
+ LAST=$(ssh -o ConnectTimeout=10 autobuild cat /home/iurt/autobuild-logs/LAST 2>/dev/null)
+ if [ -n "$LAST" ]; then
+ # Maybe the machine just booted beween getting IN_PROGRESS and LAST, so ensure IN_PROGRESS is really not there
+ IN_PROGRESS=$(ssh -o ConnectTimeout=10 autobuild cat /home/iurt/autobuild-logs/IN-PROGRESS 2>/dev/null)
+ if [ -n "$IN_PROGRESS" ]; then
+ exit
+ fi
+ LAST_CHANGE=$(ssh -o ConnectTimeout=10 autobuild stat -c %Y /home/iurt/autobuild-logs/${LAST}/log/status.core.log)
+ LOCAL_CHANGE=$(stat -c %Y /var/www/bs/autobuild/cauldron/aarch64/core/${LAST}/status.core.log)
+ if [ "$LOCAL_CHANGE" != "$LAST_CHANGE" ]; then
+ rsync -qa autobuild:/home/iurt/autobuild-logs/${LAST}/log/ /var/www/bs/autobuild/cauldron/aarch64/core/${LAST}/
+ fi
+ if [ $(readlink /var/www/bs/autobuild/cauldron/aarch64/core/latest) != ${LAST} ]; then
+ pushd /var/www/bs/autobuild/cauldron/aarch64/core/
+ rm -f latest; ln -s ${LAST} latest
+ #~/cleanlogs.sh $(\ls -d 2* | tail -n 13 | head -n 10)
+ popd
+ echo "Autobuild finished at $(stat -c %y /var/www/bs/autobuild/cauldron/aarch64/core/${LAST}/status.core.log)"
+ sed -i -e 's/\x00*//' /var/www/bs/autobuild/cauldron/aarch64/core/${LAST}/status.core.log
+ ruby autobuild2.rb insert /var/www/bs/autobuild/cauldron/aarch64/core/${LAST}/status.core.log
+ ruby autobuild2.rb report /var/www/bs/autobuild/
+ fi
+ fi
+fi
diff --git a/newbuild.sh b/newbuild.sh
new file mode 100755
index 0000000..fd1f7b8
--- /dev/null
+++ b/newbuild.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+logger "Updating mirror"
+rsync -aqH --delete rsync://mirror.math.princeton.edu/pub/mageia/distrib/cauldron/ /distrib/cauldron/ --exclude debug/ --exclude armv5tl/ --exclude nonfree/ --exclude tainted/ --exclude armv7hl/ --exclude x86_64/ --exclude i586/
+
+~/rebuild.sh $1
diff --git a/rebuild.sh b/rebuild.sh
index df98c54..bdc64b3 100755
--- a/rebuild.sh
+++ b/rebuild.sh
@@ -1,21 +1,33 @@
-# Sample script to rebuild the distribution
-
-# mount -t tmpfs none /home/pterjan/build/ -o size=100G,nr_inodes=32M
-stat -f -c %T /home/pterjan/build | grep -q tmpfs || exit 1
-
IURT="perl -I/home/pterjan/git/iurt/lib /home/pterjan/git/iurt/iurt"
-# Rebuild chroot tarball
-$IURT --repository /distrib --discard-packages --chrooted-urpmi http://127.0.0.1/ -r cauldron x86_64 /distrib/cauldron/SRPMS/core/release/iurt-*.src.rpm
+if [ -f /distrib/logs/IN-PROGRESS ]; then
+ date=`cat /distrib/logs/IN-PROGRESS`;
+ logger -s "Resuming ${date}"
+else
+ date=$1
+ [ -z "$date" ] && date=$(date +%Y-%m-%d)
+ logger -s "Starting new build ${date}"
+ echo $date > /distrib/logs/IN-PROGRESS
+fi
+
+# Rebuild chroot tarball, needed on resume too as we lose it when rebooting
+$IURT --repository /distrib --discard-packages --chrooted-urpmi /distrib -r cauldron x86_64 /distrib/cauldron/SRPMS/core/release/iurt-*.src.rpm || exit 1
-dir="$HOME/build/$(date +%Y-%m-%d)"
-[ -d $dir ] && exit 2
+dir="/distrib/logs/$date"
mkdir -p "$dir/log"
cat /distrib/cauldron/*/VERSION | sort > "$dir/log/VERSION"
if [ "$IURT_NUM_SHARDS" != "" -a "$IURT_SHARD_ID" != "" ]; then
- shardopts="--num_shards $IURT_NUM_SHARDS --shard_id $IURT_SHARD_ID"
+ shardopts="--num_shards $IURT_NUM_SHARDS --shard_id $IURT_SHARD_ID"
fi
-nproc=$(/usr/bin/getconf _NPROCESSORS_ONLN)
-$IURT --discard-packages --config local_spool "$dir" --repository /distrib --chrooted-urpmi http://127.0.0.1/ --parallel 10 --rpmmacros '%_smp_mflags %(echo %name | grep -q -v "^(auto-multiple-choice|boost|chromium-browser-beta|davfs2|dbus-java|ddclient|dhcp|dmraid|docbook-dtd31-sgml|dosemu|dsniff|eclipse-eclox|eclipse-texlipse|evolution-kolab|fdesktoprecorder|ghostpcl|gmic|inn|kmozillahelper|kscd|kscreen|lincity-ng|lv2|mdadm|modello|monkeystudio|most|motion|munin|mysql-workbench|mythtv|nabi|opencascade|opencpn|openjade|ORBit2|pam|pcb|plotutils|polkit|python-cairo|python-dtopt|python-qwt|qbittorrent|qeven|qterminal|qtiplot|qtwebkit|qupzilla|resolvconf|rosegarden|rt-tests|scidavis|scidvspc|scite|screenfetch|semantik|slrn|spamassassin|spring|springlobby|stardict-quick-eng-fra|sugar-base|syslog-ng|tcptraceroute|thunderbird|tor|util-vserver|waf|wine-gecko|wine-mono|xaos|xmms2|yaflight|evolution-kolab|spring|qtwebkit5|mysql-workbench|xdvik|libvirt-glib)$" && echo -n "-j4 " || echo "-l'$nproc' -j'$nproc'")' '%_install_langs en_GB:en_US:fr:fr_FR' --distro cauldron -a x86_64 --build-all $shardopts -m core > "$dir/iurt.log" 2>&1
+$IURT --discard-packages --config local_spool "$dir" --repository /distrib --chrooted-urpmi /distrib --parallel 8 --rpmmacros '%_smp_mflags -j8' --distro cauldron -a aarch64 --build-all --fixed_media --resume $shardopts -m core >> "$dir/iurt.log" 2>&1
+
+# Retry failures once, in case it's transient
+#sed -i '/failure$/d' "$dir/log/status.core.log"
+#$IURT --discard-packages --config local_spool "$dir" --repository /distrib --chrooted-urpmi http://127.0.0.1/ --parallel 8 --rpmmacros '%_smp_mflags -j16' --distro cauldron -a x86_64 --build-all --resume -m core >> "$dir/iurt.log" 2>&1
+
+mv -f /distrib/logs/{IN-PROGRESS,LAST}
+
+#sleep 900
+#sudo shutdown -h