]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/infrastructure/xonotic-release-build.cron
Merge branch 'bones_was_here/build.cron' into 'master'
[xonotic/xonotic.git] / misc / infrastructure / xonotic-release-build.cron
1 #!/bin/sh
2
3 if [ -z "$RELEASETYPE" ]; then
4         export RELEASETYPE=autobuild
5         #export RELEASETYPE=release
6 fi
7
8 case "$RELEASETYPE" in
9         autobuild)
10                 RELEASETYPEDIR=
11                 RELEASETYPENAME="$RELEASETYPE"
12                 ;;
13         *)
14                 RELEASETYPEDIR="$RELEASETYPE/"
15                 RELEASETYPENAME="$RELEASETYPE-like build"
16                 ;;
17 esac
18
19 # is being run as cronjob, better set PATH
20 export PATH=/home/xonotic-build/ccache:/home/xonotic-build/bin:/usr/local/bin:/usr/bin:/bin:/usr/games
21
22 # TEST: use s2tc, high quality
23 #export dds_tool=s2tc
24
25 mepwd=$PWD
26 me=$0
27
28 if rm "$me.not-today" 2>/dev/null; then
29         echo "No build today (not-today marker removed)!"
30         exit 0
31 fi
32
33 set -ex
34
35 ssh autobuild-release-uploader@beta.xonotic.org '
36         set -e;
37         cd HTML/autobuild/;
38         s0=`date -d "now - 7 days - 12 hours" +%s`;
39         s00=`date -d "now - 60 days - 12 hours" +%s`;
40         for X in * */*; do
41                 [ -f "$X" ] || continue;
42                 d=${X##*/};
43                 d=${d#Xonotic-};
44                 d=${d#gmqcc-};
45                 d=${d%%[-_.]*};
46                 [ x"$d" != x"latest" ] || continue;
47                 w=`date -d $d +%w`;
48                 s=`date -d $d +%s`;
49                 if [ "$w" -ne 0 -a "$s" -lt "$s0" -o "$s" -lt "$s00" ]; then
50                         rm -f "$X";
51                 fi;
52         done
53 '
54 cd ~/xonotic-release-build
55 ./all clean --reclone
56 # ./all checkout maint
57 ./all checkout
58 ./all each git checkout HEAD^0
59 # add all feature branches we want
60
61 # map branches that we include:
62 #   winners in the poll for upcoming CTF maps
63 #   maps near completion
64
65 ## for b in \
66 ##      origin/divVerent/rebase/for-autobuild \
67 ## ; do
68 ##      b=$b ./all each sh -c 'if git rev-parse $b >/dev/null 2>&1; then git merge $b; fi'
69 ## done
70 ./all update -N
71 d0=`date +%Y%m%d`
72 d=$d0
73 i=1
74 while HEAD http://xonotic:g-23@beta.xonotic.org/autobuild/"$RELEASETYPEDIR""Xonotic-$d.zip"; do
75         i=$(($i+1))
76         d="$d0"_"$i"
77 done
78 RELEASEDATE=$d xvfb-run ./all release
79 for X in Xonotic-$d*.zip; do
80         ln -snf "$X" "Xonotic-latest${X#Xonotic-$d}"
81 done
82 rsync -vaSHP Xonotic*.zip autobuild-release-uploader@beta.xonotic.org:HTML/autobuild/"$RELEASETYPEDIR"
83 if [ -z "$RELEASETYPEDIR" ]; then
84         ssh autobuild-release-uploader@beta.xonotic.org sh update-rsync.sh "$d"
85 fi
86 echo "Finished a new $RELEASETYPENAME at http://beta.xonotic.org/autobuild/$RELEASETYPEDIR" | $IRCSPAM
87 cd