6 url_http=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 build_override="-bsp_timeout 900 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
11 screenshot_override="9 600 +g_ctf 1"
19 for F in `git show "${commithash}:maps/"`; do
28 blobhash=`git rev-parse --revs-only "${commithash}:maps/$M.map.options" || true`-`git rev-parse --revs-only "${commithash}:maps/$M.map" || true`
35 "$@" "$M" "$blobhash" "$commithash"
48 branch=${branch##refs/heads/}
49 branch=${branch##refs/remotes/}
50 branch=${branch##origin/}
51 hash=`echo "$hash" | cut -c 1-7`
53 echo "[$branch $hash] starting map compile of $map"
64 branch=${branch##refs/heads/}
65 branch=${branch##refs/remotes/}
66 branch=${branch##origin/}
67 hash=`echo "$hash" | cut -c 1-7`
71 if [ "$status" -ne 0 ]; then
72 s_error="exited with status $status"
75 if [ -n "$s_error" ]; then
76 echo "[$branch $hash]
\ 34screenshots of $map could not be made: $s_error"
78 echo "[$branch $hash] screenshots of $map are available on $url"
91 hash=`echo "$hash" | cut -c 1-7`
93 branch=${branch##refs/heads/}
94 branch=${branch##refs/remotes/}
95 branch=${branch##origin/}
102 if [ "$status" -ne 0 ]; then
103 s_error="exited with status $status"
105 while IFS= read -r L; do
107 WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
109 if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
113 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
116 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
117 s_failshaders="$s_failshaders ${L##* }"
119 '******* leaked *******')
122 '************ ERROR ************')
127 s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
128 s_failshaders=${s_failshaders# }
129 if [ -n "$s_error" ]; then
130 echo -n "[$branch $hash]
\ 34failed"
132 echo -n "[$branch $hash] finished"
134 echo -n " map compile of $map ($url): $time sec"
135 if [ -n "$s_samplesize" ]; then
136 echo -n ", FIX samplesize >= $s_samplesize"
138 if [ -n "$s_failshaders" ]; then
139 if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
140 s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
142 echo -n ", FIX shaders $s_failshaders"
144 if [ -n "$s_leaked" ]; then
147 if [ -n "$s_error" ]; then
148 s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
149 echo -n ", ERROR: $s_error"
161 if HEAD "$url$M-$blobhash.pk3"; then
167 git checkout -f "$HASH"
169 if [ -n "$IRCSPAM" ]; then
170 pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
175 ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $build_override > "$M.log"
180 if [ -n "$IRCSPAM" ]; then
181 cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" "$status" "$dt" > "maps/$M.irc"
183 zip -9r "$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
184 ln -snf "../$M-$blobhash.pk3" "$M.pk3" # from ALL branches, so beware!
185 cp "$M-$blobhash.pk3" "$M-full-$blobhash.pk3"
186 zip -9r "$M-full-$blobhash.pk3" `git diff --name-only --diff-filter=ACMRTUXB master...HEAD` || true
187 ln -snf "../$M-full-$blobhash.pk3" "$M-full.pk3" # from ALL branches, so beware!
188 rsync -vaSHP "$M-$blobhash.pk3" "$M-full-$blobhash.pk3" "$url_ssh"
189 rsync -vaSHP "$M.pk3" "$M-full.pk3" "$url_ssh""latest/"
190 if [ -n "$IRCSPAM" ]; then
191 $IRCSPAM < "maps/$M.irc"
202 if HEAD "$url$M-$blobhash/"; then
208 git checkout -f "$HASH"
213 if [ -n "$DISPLAY" ]; then
214 misc/tools/xonotic-map-screenshot "$M" $screenshot_override +"scr_screenshot_name \"$M-\""
216 startx "$PWD/misc/tools/xonotic-map-screenshot" "$M" $screenshot_override +"scr_screenshot_name \"$M-\"" -- :8
219 if ! mv ~/.xonotic/data/screenshots "$M-$blobhash"; then
220 if [ -n "$IRCSPAM" ]; then
221 #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$HASH" 1 > "maps/$M.ircss"
222 ss2spam "$M" "$url?d" "$REFNAME" "$HASH" 1 > "maps/$M.ircss"
226 if [ -n "$IRCSPAM" ]; then
227 #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$HASH" 0 > "maps/$M.ircss"
228 ss2spam "$M" "$url?d" "$REFNAME" "$HASH" 0 > "maps/$M.ircss"
230 chmod 1777 "$M-$blobhash"
231 ln -snf "../$M-$blobhash" "$M" # from ALL branches, so beware!
232 rsync -vaSHP "$M-$blobhash" "$url_ssh"
233 rsync -vaSHP "$M" "$url_ssh""latest/"
234 if [ -n "$IRCSPAM" ]; then
235 $IRCSPAM < "maps/$M.ircss"
247 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
250 if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
251 if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
252 rm -f "$bspdir/$M-$blobhash.pk3"
253 echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
258 if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
259 rm -f "$bspdir/$M-$blobhash.pk3"
260 echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
272 echo "$M $blobhash $HASH $REFNAME"
277 mkdir -p "$bspdir" "$bspdir.old"
278 for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
280 mv "$b" "$bspdir.old"/
283 allmaps "HEAD" getthemap "$url_http" "$bspdir.old" "$bspdir"
288 git for-each-ref 'refs/remotes' | grep -vE ' refs/remotes/([^/]*/HEAD|.*/archived/.*)$'
293 cd data/xonotic-maps.pk3dir
294 branches | while read -r HASH TYPE REFNAME; do
295 allmaps "$HASH" indexthemap "$REFNAME"
302 cd data/xonotic-maps.pk3dir
303 branches | while read -r HASH TYPE REFNAME; do
304 if [ -f "$build_cachedir/$HASH" ]; then
307 allmaps "$HASH" buildthemap "$REFNAME" "$url_http"
308 touch "$build_cachedir/$HASH"
310 git checkout -f master
313 runmakeindex > "branches.idx.new"
314 rsync -vaSHP "branches.idx.new" "$url_ssh""branches.idx.new"
315 rm -f "branches.idx.new"
316 cd data/xonotic-maps.pk3dir
317 branches | while read -r HASH TYPE REFNAME; do
318 if [ -f "$screenshot_cachedir/$HASH" ]; then
323 if $getthemap_fail; then
327 cd data/xonotic-maps.pk3dir
328 allmaps "$HASH" screenshotthemap "$REFNAME" "$url_http"
331 touch "$screenshot_cachedir/$HASH"
333 git checkout -f master
339 cd data/xonotic-maps.pk3dir
342 echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
343 ls -l "$bspdir.old" || true
348 rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
349 wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url_http""latest"
352 log2spam "mapname" "http://mapurl" "branch" "commit" "0"