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 300 +g_ctf 1"
17 for F in maps/*.map.options; do
18 if ! [ -f "$F" ]; then
21 if ! [ -f "${F%.options}" ]; then
26 blobhash=`git ls-files -s -- "$F" | cut -d ' ' -f 2`-`git ls-files -s -- "${F%.options}" | cut -d ' ' -f 2`
38 branch=${branch##refs/heads/}
39 branch=${branch##refs/remotes/}
40 branch=${branch##origin/}
41 hash=`echo "$hash" | cut -c 1-7`
43 echo "[$branch $hash] starting map compile of $map"
54 branch=${branch##refs/heads/}
55 branch=${branch##refs/remotes/}
56 branch=${branch##origin/}
57 hash=`echo "$hash" | cut -c 1-7`
61 if [ "$status" -ne 0 ]; then
62 s_error="exited with status $status"
65 if [ -n "$s_error" ]; then
66 echo "[$branch $hash]
\ 34screenshots of $map could not be made: $s_error"
68 echo "[$branch $hash] screenshots of $map are available on $url"
81 hash=`echo "$hash" | cut -c 1-7`
83 branch=${branch##refs/heads/}
84 branch=${branch##refs/remotes/}
85 branch=${branch##origin/}
92 if [ "$status" -ne 0 ]; then
93 s_error="exited with status $status"
95 while IFS= read -r L; do
97 WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
99 if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
103 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
106 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
107 s_failshaders="$s_failshaders ${L##* }"
109 '******* leaked *******')
112 '************ ERROR ************')
117 s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
118 s_failshaders=${s_failshaders# }
119 if [ -n "$s_error" ]; then
120 echo -n "[$branch $hash]
\ 34failed"
122 echo -n "[$branch $hash] finished"
124 echo -n " map compile of $map ($url): $time sec"
125 if [ -n "$s_samplesize" ]; then
126 echo -n ", FIX samplesize >= $s_samplesize"
128 if [ -n "$s_failshaders" ]; then
129 if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
130 s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
132 echo -n ", FIX shaders $s_failshaders"
134 if [ -n "$s_leaked" ]; then
137 if [ -n "$s_error" ]; then
138 s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
139 echo -n ", ERROR: $s_error"
151 if HEAD "$url$M-$blobhash.pk3"; then
154 if [ -n "$IRCSPAM" ]; then
155 pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
160 ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $build_override > "$M.log"
165 if [ -n "$IRCSPAM" ]; then
166 cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" "$status" "$dt" > "maps/$M.irc"
168 zip -9r "$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
169 ln -snf "../$M-$blobhash.pk3" "$M.pk3" # from ALL branches, so beware!
170 cp "$M-$blobhash.pk3" "$M-full-$blobhash.pk3"
171 zip -9r "$M-full-$blobhash.pk3" `git diff --name-only --diff-filter=ACMRTUXB master...HEAD` || true
172 ln -snf "../$M-full-$blobhash.pk3" "$M-full.pk3" # from ALL branches, so beware!
173 rsync -vaSHP "$M-$blobhash.pk3" "$M-full-$blobhash.pk3" "$url_ssh"
174 rsync -vaSHP "$M.pk3" "$M-full.pk3" "$url_ssh""latest/"
175 if [ -n "$IRCSPAM" ]; then
176 $IRCSPAM < "maps/$M.irc"
187 if HEAD "$url$M-$blobhash/"; then
193 if [ -n "$DISPLAY" ]; then
194 misc/tools/xonotic-map-screenshot "$M" $screenshot_override +"scr_screenshot_name \"$M-\""
196 startx "$PWD/misc/tools/xonotic-map-screenshot" "$M" $screenshot_override +"scr_screenshot_name \"$M-\"" -- :8
199 if ! mv ~/.xonotic/data/screenshots "$M-$blobhash"; then
200 if [ -n "$IRCSPAM" ]; then
201 #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$HASH" 1 > "maps/$M.ircss"
202 ss2spam "$M" "$url?d" "$REFNAME" "$HASH" 1 > "maps/$M.ircss"
206 if [ -n "$IRCSPAM" ]; then
207 #ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$HASH" 0 > "maps/$M.ircss"
208 ss2spam "$M" "$url?d" "$REFNAME" "$HASH" 0 > "maps/$M.ircss"
210 chmod 1777 "$M-$blobhash"
211 ln -snf "../$M-$blobhash" "$M" # from ALL branches, so beware!
212 rsync -vaSHP "$M-$blobhash" "$url_ssh"
213 rsync -vaSHP "$M" "$url_ssh""latest/"
214 if [ -n "$IRCSPAM" ]; then
215 $IRCSPAM < "maps/$M.ircss"
226 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
229 if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
230 if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
231 rm -f "$bspdir/$M-$blobhash.pk3"
232 echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
237 if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
238 rm -f "$bspdir/$M-$blobhash.pk3"
239 echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
247 cd data/xonotic-maps.pk3dir
248 git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
254 if [ -f "$build_cachedir/$HASH" ]; then
259 git checkout -f "$HASH"
260 allmaps buildthemap "$REFNAME" "$HASH" "$url_http"
261 touch "$build_cachedir/$HASH"
263 git checkout -f master
266 cd data/xonotic-maps.pk3dir
267 git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
273 if [ -f "$screenshot_cachedir/$HASH" ]; then
278 git checkout -f "$HASH"
281 mkdir -p "$bspdir" "$bspdir.old"
282 for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
284 mv "$b" "$bspdir.old"/
287 cd data/xonotic-maps.pk3dir
288 allmaps getthemap "$url_http" "$bspdir.old" "$bspdir"
290 if ! $getthemap_fail; then
291 allmaps screenshotthemap "$REFNAME" "$HASH" "$url_http"
292 touch "$screenshot_cachedir/$HASH"
295 git checkout -f master
298 mkdir -p "$bspdir" "$bspdir.old"
299 for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
301 mv "$b" "$bspdir.old"/
304 cd data/xonotic-maps.pk3dir
305 allmaps getthemap "$url_http" "$bspdir.old" "$bspdir"
306 echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
312 rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
313 wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url_http""latest"
316 log2spam "mapname" "http://mapurl" "branch" "commit" "0"