Compare commits

...

4 Commits

6 changed files with 35 additions and 7 deletions

View File

@ -5,7 +5,8 @@
<!-- start autogeneration tags -->
* `1.1.99`
* `1.1.98`
* `1.1.102`, `latest`
* `1.1.103`, `latest`
* `1.1.102`
* `1`, `1.1`, `1.1.101`, `stable`
* `1.0`, `1.0.0`
* `0.17`, `0.17.79`

View File

@ -72,8 +72,14 @@
"1.1.102": {
"sha256": "f68cbf9ec32f750d37675f998467eadfc3d580d8ec7b14e64b1e9ef1a895a7e1",
"tags": [
"latest",
"1.1.102"
]
},
"1.1.103": {
"sha256": "53dc6040181402e78a435eeb01c6cde1a4fe8aa676eb4c051433af3e6b4f92fa",
"tags": [
"latest",
"1.1.103"
]
}
}

9
docker/Dockerfile Normal file → Executable file
View File

@ -7,6 +7,14 @@ ARG GROUP=factorio
ARG PUID=845
ARG PGID=845
# optionally utilize a built-in map-gen-preset (see data/base/prototypes/map-gen-presets
# if this is used, the preset will be used over any .json files supplied
# vanilla factorio provides the following presets:
# rich-resources, marathon, death-world, death-world-marathon, rail-world, ribbon-world, island
# a modded factorio example for using this:
# space-exploration
ARG PRESET
# version checksum of the archive to download
ARG VERSION
ARG SHA256
@ -19,6 +27,7 @@ ENV PORT=34197 \
VERSION=${VERSION} \
SHA256=${SHA256} \
SAVES=/factorio/saves \
PRESET="$PRESET" \
CONFIG=/factorio/config \
MODS=/factorio/mods \
SCENARIOS=/factorio/scenarios \

View File

@ -20,4 +20,5 @@ services:
# - USERNAME=FactorioUsername
# - TOKEN=FactorioToken
# - PORT=34198
# - PRESET=deathworld
# - ADDR=::1

View File

@ -1,9 +1,9 @@
#!/bin/bash
set -eoux pipefail
FACTORIO_VOL=/factorio
LOAD_LATEST_SAVE="${LOAD_LATEST_SAVE:-true}"
GENERATE_NEW_SAVE="${GENERATE_NEW_SAVE:-false}"
PRESET="${PRESET:-""}"
SAVE_NAME="${SAVE_NAME:-""}"
BIND="${BIND:-""}"
CONSOLE_LOG_LOCATION="${CONSOLE_LOG_LOCATION:-""}"
@ -70,12 +70,20 @@ if [[ $GENERATE_NEW_SAVE == true ]]; then
fi
if [[ -f "$SAVES/$SAVE_NAME.zip" ]]; then
echo "Map $SAVES/$SAVE_NAME.zip already exists, skipping map generation"
else
if [[ ! -z "$PRESET" ]]; then
$SU_EXEC /opt/factorio/bin/x64/factorio \
--create "$SAVES/$SAVE_NAME.zip" \
--preset "$PRESET" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json"
else
$SU_EXEC /opt/factorio/bin/x64/factorio \
--create "$SAVES/$SAVE_NAME.zip" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json"
fi
fi
fi
FLAGS=(\

View File

@ -6,6 +6,8 @@ if [[ -z ${1:-} ]]; then
fi
SERVER_SCENARIO="$1"
PRESET="${PRESET:-""}"
mkdir -p "$SAVES"
mkdir -p "$CONFIG"
mkdir -p "$MODS"
@ -32,6 +34,7 @@ fi
exec /opt/factorio/bin/x64/factorio \
--port "$PORT" \
--start-server-load-scenario "$SERVER_SCENARIO" \
--preset "$PRESET" \
--map-gen-settings "$CONFIG/map-gen-settings.json" \
--map-settings "$CONFIG/map-settings.json" \
--server-settings "$CONFIG/server-settings.json" \