6 url=http://beta.xonotic.org/autobuild-bsp/
7 url_ssh=xonotic-beta:autobuild-bsp/
8 build_cachedir="$HOME/xonotic-map-compiler.cache/"
9 screenshot_cachedir="$HOME/xonotic-map-screenshot.cache/"
10 override="-bsp_timeout 900 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
11 screenshot_override="9 300"
15 for F in maps/*.map.options; do
16 if ! [ -f "$F" ]; then
19 if ! [ -f "${F%.options}" ]; then
24 blobhash=`git ls-files -s -- "$F" | cut -d ' ' -f 2`-`git ls-files -s -- "${F%.options}" | cut -d ' ' -f 2`
36 branch=${branch##refs/heads/}
37 branch=${branch##refs/remotes/}
38 branch=${branch##origin/}
39 hash=`echo "$hash" | cut -c 1-7`
41 echo "[$branch $hash] starting map compile of $map"
51 branch=${branch##refs/heads/}
52 branch=${branch##refs/remotes/}
53 branch=${branch##origin/}
54 hash=`echo "$hash" | cut -c 1-7`
56 echo "[$branch $hash] screenshots of $map are available on $url"
68 hash=`echo "$hash" | cut -c 1-7`
70 branch=${branch##refs/heads/}
71 branch=${branch##refs/remotes/}
72 branch=${branch##origin/}
79 if [ "$status" -ne 0 ]; then
80 s_error="exited with status $status"
82 while IFS= read -r L; do
84 WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
86 if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
90 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
93 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
94 s_failshaders="$s_failshaders ${L##* }"
96 '******* leaked *******')
99 '************ ERROR ************')
104 s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
105 s_failshaders=${s_failshaders# }
106 if [ -n "$s_error" ]; then
107 echo -n "[$branch $hash]
\ 34failed"
109 echo -n "[$branch $hash] finished"
111 echo -n " map compile of $map ($url): $time sec"
112 if [ -n "$s_samplesize" ]; then
113 echo -n ", FIX samplesize >= $s_samplesize"
115 if [ -n "$s_failshaders" ]; then
116 if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
117 s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
119 echo -n ", FIX shaders $s_failshaders"
121 if [ -n "$s_leaked" ]; then
124 if [ -n "$s_error" ]; then
125 s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
126 echo -n ", ERROR: $s_error"
138 if HEAD "$url$M-$blobhash.pk3"; then
141 if [ -n "$IRCSPAM" ]; then
142 pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
147 ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $override > "$M.log"
152 if [ -n "$IRCSPAM" ]; then
153 cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" "$status" "$dt" > "maps/$M.irc"
155 zip -9r "$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
156 ln -snf "../$M-$blobhash.pk3" "$M.pk3" # from ALL branches, so beware!
157 cp "$M-$blobhash.pk3" "$M-full-$blobhash.pk3"
158 zip -9r "$M-full-$blobhash.pk3" `git diff --name-only --diff-filter=ACMRTUXB master...HEAD` || true
159 ln -snf "../$M-full-$blobhash.pk3" "$M-full.pk3" # from ALL branches, so beware!
160 rsync -vaSHP "$M-$blobhash.pk3" "$M-full-$blobhash.pk3" "$url_ssh"
161 rsync -vaSHP "$M.pk3" "$M-full.pk3" "$url_ssh""latest/"
162 if [ -n "$IRCSPAM" ]; then
163 $IRCSPAM < "maps/$M.irc"
174 if HEAD "$url$M-$blobhash/"; then
180 if [ -n "$IRCSPAM" ]; then
181 ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$HASH" > "maps/$M.ircss"
183 mv ~/.xonotic/data/screenshots "$M-$blobhash"
184 ln -snf "../$M-$blobhash" "$M" # from ALL branches, so beware!
185 rsync -vaSHP "$M-$blobhash" "$url_ssh"
186 rsync -vaSHP "$M" "$url_ssh""latest/"
187 if [ -n "$IRCSPAM" ]; then
188 $IRCSPAM < "maps/$M.ircss"
199 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
202 if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
203 if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
204 rm -f "$bspdir/$M-$blobhash.pk3"
205 echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
209 if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
210 rm -f "$bspdir/$M-$blobhash.pk3"
211 echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
218 cd data/xonotic-maps.pk3dir
219 git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
220 if [ -f "$build_cachedir/$HASH" ]; then
225 git checkout -f "$HASH"
226 allmaps buildthemap "$REFNAME" "$HASH" "$url"
227 touch "$build_cachedir/$HASH"
229 git checkout -f master
232 cd data/xonotic-maps.pk3dir
233 git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
234 if [ -f "$screenshot_cachedir/$HASH" ]; then
239 git checkout -f "$HASH"
240 allmaps screenshotthemap "$REFNAME" "$HASH" "$url"
241 touch "$screenshot_cachedir/$HASH"
243 git checkout -f master
246 mkdir -p "$bspdir" "$bspdir.old"
247 for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
249 mv "$b" "$bspdir.old"/
252 cd data/xonotic-maps.pk3dir
253 allmaps getthemap "$url" "$bspdir.old" "$bspdir"
254 echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
260 rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
261 wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url""latest"
264 log2spam "mapname" "http://mapurl" "branch" "commit" "0"