]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/infrastructure/xonotic-release-build.cron
Disable feature branches in the release script, since they no longer exist
[xonotic/xonotic.git] / misc / infrastructure / xonotic-release-build.cron
1 #!/bin/sh
2
3 # is being run as cronjob, better set PATH
4 export PATH=/home/xonotic-build/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
5
6 mepwd=$PWD
7 me=$0
8 if ! lockfile-create "$me"; then
9         exit 1
10 fi
11 lockfile-touch "$me" & lockpid=$!
12 trap 'kill $lockpid || true; cd "$mepwd"; lockfile-remove "$me"' EXIT
13 trap 'exit 1' INT TERM
14
15 set -ex
16 export HOSTS_THAT_ARE_MYSELF="xonotic-build-win32 xonotic-build-win64"
17 export HOSTS_THAT_ARE_DISABLED=""
18 ssh xonotic-beta '
19         cd autobuild/;
20         s0=`date -d "now - 7 days - 12 hours" +%s`;
21         s00=`date -d "now - 60 days - 12 hours" +%s`;
22         for X in *; do
23                 [ -f "$X" ] || continue;
24                 d=${X#Xonotic-};
25                 d=${d%%[_-.]*};
26                 [ x"$d" != x"latest" ] || continue;
27                 w=`date -d $d +%w`;
28                 s=`date -d $d +%s`;
29                 if [ "$w" -ne 0 -a "$s" -lt "$s0" -o "$s" -lt "$s00" ]; then
30                         rm -f "$X";
31                 fi;
32         done
33 '
34 cd ~/xonotic-release-build
35 ./all clean --reclone
36 ./all each git checkout HEAD^0
37 # add all feature branches we want
38
39 # map branches that we include:
40 #   winners in the poll for upcoming CTF maps
41 #   maps near completion
42 # uncomment below when a branch is needed
43 # the listed branches are examples only
44
45 #for b in \
46 #       origin/fruitiex/runningmanctf \
47 #       origin/mintox/geoplanetary
48 #do
49 #       b=$b ./all each sh -c 'if git rev-parse $b >/dev/null 2>&1; then git merge $b; fi'
50 #done
51 ./all update -N
52 d0=`date +%Y%m%d`
53 d=$d0
54 i=1
55 while HEAD http://xonotic:g-23@beta.xonotic.org/autobuild/"Xonotic-$d.zip"; do
56         i=$(($i+1))
57         d="$d0"_"$i"
58 done
59 RELEASETYPE=beta RELEASEDATE=$d ./all release
60 for X in Xonotic-$d*.zip; do
61         ln -snf "$X" "Xonotic-latest${X#Xonotic-$d}"
62 done
63 rsync -vaSHP Xonotic*.zip xonotic-beta:autobuild/
64 ssh xonotic-beta sh update-rsync.sh "$d"
65 echo "Finished a new beta build at http://beta.xonotic.org/autobuild/" | $IRCSPAM
66 cd