mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 04:53:36 +00:00
[generator] Add a test generation flag
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user