]> git.xonotic.org Git - xonotic/xonotic.git/blob - misc/infrastructure/xonotic-release-build.cron
Import updated release build script.
[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 # Try crunch.
26 export CACHEDIR=$HOME/.xonotic-cached-converter-crunch
27 export dds_tool=crunch
28
29 mepwd=$PWD
30 me=$0
31
32 if rm "$me.not-today" 2>/dev/null; then
33         echo "No build today (not-today marker removed)!"
34         exit 0
35 fi
36
37 set -ex
38
39 # TODO re-enable this cleanup script
40 : ssh autobuild-release-uploader@beta.xonotic.org '
41         set -e;
42         cd HTML/autobuild/;
43         s0=`date -d "now - 7 days - 12 hours" +%s`;
44         s00=`date -d "now - 60 days - 12 hours" +%s`;
45         for X in * */*; do
46                 [ -f "$X" ] || continue;
47                 d=${X##*/};
48                 d=${d#Xonotic-};
49                 d=${d#gmqcc-};
50                 d=${d%%[-_.]*};
51                 [ x"$d" != x"latest" ] || continue;
52                 w=`date -d $d +%w`;
53                 s=`date -d $d +%s`;
54                 if [ "$w" -ne 0 -a "$s" -lt "$s0" -o "$s" -lt "$s00" ]; then
55                         rm -f "$X";
56                 fi;
57         done
58 '
59 cd ~/xonotic-release-build
60 ./all clean --reclone
61 # ./all checkout maint
62 ./all checkout
63 ./all each git checkout HEAD^0
64 # add all feature branches we want
65
66 # map branches that we include:
67 #   winners in the poll for upcoming CTF maps
68 #   maps near completion
69
70 ## for b in \
71 ##      origin/divVerent/rebase/for-autobuild \
72 ## ; do
73 ##      b=$b ./all each sh -c 'if git rev-parse $b >/dev/null 2>&1; then git merge $b; fi'
74 ## done
75 ./all update -N
76 d0=`date +%Y%m%d`
77 d=$d0
78 i=1
79 while HEAD -C xonotic:g-23 http://beta.xonotic.org/autobuild/"$RELEASETYPEDIR""Xonotic-$d.zip"; do
80         i=$(($i+1))
81         d="$d0"_"$i"
82 done
83 RELEASEDATE=$d ./all release
84 for X in Xonotic-$d*.zip; do
85         ln -snf "$X" "Xonotic-latest${X#Xonotic-$d}"
86 done
87 rsync -vaSHP Xonotic*.zip autobuild-release-uploader@beta.xonotic.org:"$RELEASETYPEDIR"
88 if [ -z "$RELEASETYPEDIR" ]; then
89         ssh autobuild-release-uploader@beta.xonotic.org sh ../../update-rsync.sh "$d"
90 fi
91 echo "Finished a new $RELEASETYPENAME at http://beta.xonotic.org/autobuild/$RELEASETYPEDIR" | $IRCSPAM
92 cd