]> de.git.xonotic.org Git - xonotic/xonotic.git/blobdiff - misc/tools/xonotic-map-compiler-autobuild
Map screenshot server: when downloading maps for a branch fails, still try screenshot...
[xonotic/xonotic.git] / misc / tools / xonotic-map-compiler-autobuild
index d7a3a9364779c028fd16725b22432b99bad94b66..75306ced9d64f892e713e5ae4f3bbad13bd3f2d0 100755 (executable)
@@ -7,7 +7,7 @@ url_http=http://beta.xonotic.org/autobuild-bsp/
 url_ssh=xonotic-beta:autobuild-bsp/
 build_cachedir="$HOME/xonotic-map-compiler.cache/"
 screenshot_cachedir="$HOME/xonotic-map-screenshot.cache/"
-build_override="-bsp_timeout 5400 -vis_timeout 3600 -light_timeout 14400 -minimap_timeout 900 -scale_timeout 900"
+build_override="-bsp_timeout 3600 -vis_timeout 10800 -light_timeout 18000 -minimap_timeout 900 -scale_timeout 900 -timeout_stealing 0.8"
 screenshot_override="9 900 5 +g_ctf 1"
 
 getthemap_fail=false
@@ -174,14 +174,41 @@ buildthemap()
        if [ -n "$IRCSPAM" ]; then
                pre2spam "$M" "$url$M-$blobhash.pk3" "$REFNAME" "$commithash" | $IRCSPAM || true
        fi
+
        t0=`date +%s`
-       (
+
+       # It's sad that we must enforce this rule by code.
+       if grep -- '-nosRGB' "maps/$M.map.options" >/dev/null; then
+               is_nosrgb=true
+       else
+               is_nosrgb=false
+       fi
+       allow_build=true
+       if $is_nosrgb; then
+               case "$REFNAME" in
+                       master|refs/heads/master|origin/master|refs/remotes/origin/master)
+                               if [ -n "$IRCSPAM" ]; then
+                                       echo "\ 34ERROR: map $M uses -nosRGB. This is not acceptable in master. Please fix." | $IRCSPAM || true
+                               fi
+                               allow_build=false
+                               ;;
+                       *)
+                               if [ -n "$IRCSPAM" ]; then
+                                       echo "\ 34WARNING:\ f map $M uses -nosRGB. This is not acceptable in master. Please fix." | $IRCSPAM || true
+                               fi
+                               ;;
+               esac
+       fi
+
+       set +e
+       $allow_build && (
                cd ../..
-               misc/tools/xonotic-map-compiler-optionsfile "data/xonotic-data.pk3dir/maps/$M" $build_override > "$M.log" 2>&1
+               misc/tools/xonotic-map-compiler-optionsfile "data/xonotic-maps.pk3dir/maps/$M" $build_override > "data/xonotic-maps.pk3dir/maps/$M.log" 2>&1
        )
        status=$?
+       set -e
        if ! [ -f "maps/$M.bsp" ]; then
-               echo >>"$M.log" "ERROR: No BSP file"
+               echo >>"maps/$M.log" "ERROR: No BSP file"
        fi
        t1=`date +%s`
        dt=$(($t1 - $t0))
@@ -210,7 +237,7 @@ screenshotthemap()
        M=$3
        blobhash=$4
        commithash=$5
-       if lwp-request -m HEAD "$url$M-$blobhash/"; then
+       if lwp-request -m HEAD "$url$M-$blobhash/$M-000000.jpg"; then
                continue
        fi
 
@@ -250,6 +277,9 @@ screenshotthemap()
        rsync -vaSHP "$M-$blobhash" "$url_ssh"
        rsync -vaSHP "$M" "$url_ssh""latest/"
        if [ -n "$IRCSPAM" ]; then
+               # It takes about 5 minutes for the server to update.
+               sleep 360  # Cut it one more minute of slack.
+
                $IRCSPAM < "$M-$blobhash/$M.ircss" || true
        fi
        if [ -n "$BUILD_ONE" ]; then
@@ -346,6 +376,7 @@ case "$1" in
                        git clean -xfd
                        git checkout -f "$HASH"
 
+                       getthemap_fail=false
                        rundownload
                        if $getthemap_fail; then
                                continue