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 build_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"
52 branch=${branch##refs/heads/}
53 branch=${branch##refs/remotes/}
54 branch=${branch##origin/}
55 hash=`echo "$hash" | cut -c 1-7`
59 if [ "$status" -ne 0 ]; then
60 s_error="exited with status $status"
63 if [ -n "$s_error" ]; then
64 echo "[$branch $hash]
\ 34screenshots of $map could not be made: $s_error"
66 echo "[$branch $hash] screenshots of $map are available on $url"
79 hash=`echo "$hash" | cut -c 1-7`
81 branch=${branch##refs/heads/}
82 branch=${branch##refs/remotes/}
83 branch=${branch##origin/}
90 if [ "$status" -ne 0 ]; then
91 s_error="exited with status $status"
93 while IFS= read -r L; do
95 WARNING:\ surface\ at\ *\ too\ large\ for\ desired\ samplesize*)
97 if [ -z "$s_samplesize" ] || [ "$s" -gt "$s_samplesize" ]; then
101 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ textures/NULL)
104 WARNING:\ Couldn\'t\ find\ image\ for\ shader\ *)
105 s_failshaders="$s_failshaders ${L##* }"
107 '******* leaked *******')
110 '************ ERROR ************')
115 s_failshaders=`echo "$s_failshaders" | sed "s, textures/, ,g"`
116 s_failshaders=${s_failshaders# }
117 if [ -n "$s_error" ]; then
118 echo -n "[$branch $hash]
\ 34failed"
120 echo -n "[$branch $hash] finished"
122 echo -n " map compile of $map ($url): $time sec"
123 if [ -n "$s_samplesize" ]; then
124 echo -n ", FIX samplesize >= $s_samplesize"
126 if [ -n "$s_failshaders" ]; then
127 if [ -n "`echo "$s_failshaders" | cut -d ' ' -f 4-`" ]; then
128 s_failshaders="`echo "$s_failshaders" | cut -d ' ' -f 1-3`..."
130 echo -n ", FIX shaders $s_failshaders"
132 if [ -n "$s_leaked" ]; then
135 if [ -n "$s_error" ]; then
136 s_error=`echo "$s_error" | sed "s,$PWD/\?,,g"`
137 echo -n ", ERROR: $s_error"
149 if HEAD "$url$M-$blobhash.pk3"; then
152 if [ -n "$IRCSPAM" ]; then
153 pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" | $IRCSPAM
158 ../../../misc/tools/xonotic-map-compiler "$M" `grep ^- "$M.map.options" | cut -d '#' -f 1` $build_override > "$M.log"
163 if [ -n "$IRCSPAM" ]; then
164 cat "maps/$M.log" | log2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$HASH" "$status" "$dt" > "maps/$M.irc"
166 zip -9r "$M-$blobhash.pk3" "maps/$M.bsp" "maps/$M.log" "maps/$M.irc" "maps/$M/" "maps/$M.lin" "gfx/${M}_mini.tga"
167 ln -snf "../$M-$blobhash.pk3" "$M.pk3" # from ALL branches, so beware!
168 cp "$M-$blobhash.pk3" "$M-full-$blobhash.pk3"
169 zip -9r "$M-full-$blobhash.pk3" `git diff --name-only --diff-filter=ACMRTUXB master...HEAD` || true
170 ln -snf "../$M-full-$blobhash.pk3" "$M-full.pk3" # from ALL branches, so beware!
171 rsync -vaSHP "$M-$blobhash.pk3" "$M-full-$blobhash.pk3" "$url_ssh"
172 rsync -vaSHP "$M.pk3" "$M-full.pk3" "$url_ssh""latest/"
173 if [ -n "$IRCSPAM" ]; then
174 $IRCSPAM < "maps/$M.irc"
185 if HEAD "$url$M-$blobhash/"; then
190 ../../misc/tools/xonotic-map-screenshot "$M" $screenshot_override +scr_screenshot_name "$M"
192 if ! mv ~/.xonotic/data/screenshots "$M-$blobhash"; then
193 if [ -n "$IRCSPAM" ]; then
194 ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$HASH" > "maps/$M.ircss"
198 if [ -n "$IRCSPAM" ]; then
199 ss2spam "$M" "$url$M-$blobhash/" "$REFNAME" "$HASH" > "maps/$M.ircss"
201 mv ~/.xonotic/data/screenshots "$M-$blobhash"
202 ln -snf "../$M-$blobhash" "$M" # from ALL branches, so beware!
203 rsync -vaSHP "$M-$blobhash" "$url_ssh"
204 rsync -vaSHP "$M" "$url_ssh""latest/"
205 if [ -n "$IRCSPAM" ]; then
206 $IRCSPAM < "maps/$M.ircss"
217 if mv "$bspdir_old/$M-$blobhash.pk3" "$bspdir/$M-$blobhash.pk3"; then
220 if ! wget -O "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
221 if ! curl -o "$bspdir/$M-$blobhash.pk3" "$url$M-$blobhash.pk3"; then
222 rm -f "$bspdir/$M-$blobhash.pk3"
223 echo "WARNING: could not download $url$M-$blobhash.pk3, maybe not ready yet"
227 if ! unzip -l "$bspdir/$M-$blobhash.pk3"; then
228 rm -f "$bspdir/$M-$blobhash.pk3"
229 echo "WARNING: could not download $url$M-$blobhash.pk3, invalid zip file"
236 cd data/xonotic-maps.pk3dir
237 git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
238 if [ -f "$build_cachedir/$HASH" ]; then
243 git checkout -f "$HASH"
244 allmaps buildthemap "$REFNAME" "$HASH" "$url"
245 touch "$build_cachedir/$HASH"
247 git checkout -f master
250 cd data/xonotic-maps.pk3dir
251 git for-each-ref 'refs/remotes' | while read -r HASH TYPE REFNAME; do
252 if [ -f "$screenshot_cachedir/$HASH" ]; then
257 git checkout -f "$HASH"
258 allmaps screenshotthemap "$REFNAME" "$HASH" "$url"
259 touch "$screenshot_cachedir/$HASH"
261 git checkout -f master
264 mkdir -p "$bspdir" "$bspdir.old"
265 for b in "$bspdir"/*-????????????????????????????????????????-????????????????????????????????????????.pk3; do
267 mv "$b" "$bspdir.old"/
270 cd data/xonotic-maps.pk3dir
271 allmaps getthemap "$url" "$bspdir.old" "$bspdir"
272 echo "List of maps that got deleted (if any) and currently are in $bspdir.old:"
278 rm -f *-????????????????????????????????????????-????????????????????????????????????????.pk3
279 wget -r -l1 -A "*.pk3" -N --no-parent --no-directories "$url""latest"
282 log2spam "mapname" "http://mapurl" "branch" "commit" "0"