diff --git a/.forgejo/workflows/map-generator.yml b/.forgejo/workflows/map-generator.yml index 300711681..e4c0d2b88 100644 --- a/.forgejo/workflows/map-generator.yml +++ b/.forgejo/workflows/map-generator.yml @@ -17,6 +17,11 @@ on: - tiger - maps - upload + map-generator-test: + description: 'Test (non-prod) generation?' + required: false + default: false + type: boolean map-generator-continue: description: 'Continue previous map generation?' required: false @@ -43,6 +48,7 @@ env: WIKIMEDIA_PASSWORD: ${{ secrets.WIKIMEDIA_PASSWORD }} ZULIP_BOT_EMAIL: ${{ secrets.ZULIP_BOT_EMAIL }} ZULIP_API_KEY: ${{ secrets.ZULIP_API_KEY }} + MWMTEST: ${{ inputs.map-generator-test }} MWMCONTINUE: ${{ inputs.map-generator-continue }} MWMCOUNTRIES: ${{ inputs.map-generator-countries }} DEBIAN_FRONTEND: noninteractive diff --git a/tools/unix/maps/docker_maps_generator.sh b/tools/unix/maps/docker_maps_generator.sh index d0abc0b74..e1f588122 100644 --- a/tools/unix/maps/docker_maps_generator.sh +++ b/tools/unix/maps/docker_maps_generator.sh @@ -31,26 +31,26 @@ python3 -m venv /tmp/venv echo "<$(date +%T)> Copying map generator INI..." cp var/etc/map_generator.ini.prod var/etc/map_generator.ini +$GENARGS="" + +if [ $MWMTEST -gt 0 ]; then + echo "Marking as a test (non-prod) generation" + # TODO: output test maps into e.g. osm-maps-test/ and use a different generation.log + $GENARGS="$GENARGS -s=test" +fi -cd ~/comaps/tools/python if [ $MWMCONTINUE -gt 0 ]; then - -echo "<$(date +%T)> Continuing from preexisting generator run..." -/tmp/venv/bin/python -m maps_generator --skip="MwmDiffs" --continue - -else + echo "Continuing from preexisting generator run" + $GENARGS="$GENARGS --continue" +fi if [[ -n $MWMCOUNTRIES ]]; then - -echo "<$(date +%T)> Generating only specific maps [$MWMCOUNTRIES]..." -/tmp/venv/bin/python -m maps_generator --countries=$MWMCOUNTRIES --skip="MwmDiffs" - -else - -echo "<$(date +%T)> Generating maps..." -/tmp/venv/bin/python -m maps_generator --skip="MwmDiffs" - -fi + echo "Generating only specific maps for [$MWMCOUNTRIES]" + $GENARGS="$GENARGS --countries=$MWMCOUNTRIES" fi +cd ~/comaps/tools/python +echo "<$(date +%T)> Generating maps (extra args: $GENARGS)..." +/tmp/venv/bin/python -m maps_generator --skip="MwmDiffs" $GENARGS + echo "<$(date +%T)> DONE"