Compare commits
2 Commits
0c39107be0
...
adbcc3492a
Author | SHA1 | Date | |
---|---|---|---|
adbcc3492a | |||
2c1f147c67 |
@ -36,6 +36,7 @@ RUN mkdir -p /eressea/server && \
|
||||
FROM eressea-base as eressea
|
||||
ARG eressea_branch
|
||||
COPY docker-assets/backup-eressea.patch /eressea/
|
||||
COPY docker-assets/run-eressea.cron.patch /eressea/
|
||||
RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y \
|
||||
cmake luarocks libxml2-dev liblua5.2-dev libtolua-dev libncurses5-dev libsqlite3-dev \
|
||||
libexpat1-dev && \
|
||||
@ -44,6 +45,7 @@ RUN DEBIAN_FRONTEND="noninteractive" apt-get install -y \
|
||||
cd git.eressea && \
|
||||
git submodule update --init && \
|
||||
patch process/backup-eressea < /eressea/backup-eressea.patch && \
|
||||
patch process/cron/run-eressea.cron < /eressea/run-eressea.cron.patch && \
|
||||
s/cmake-init && \
|
||||
s/build && \
|
||||
ln -sf conf/eressea.ini && \
|
||||
@ -76,13 +78,13 @@ RUN apt-get update && \
|
||||
|
||||
COPY docker-assets/template-config/ /eressea/template-config/
|
||||
COPY docker-assets/lua-scripts/ /eressea/lua-scripts/
|
||||
COPY docker-assets/run-eressea.sh /eressea/run-eressea.sh
|
||||
COPY docker-assets/start.sh /eressea/start.sh
|
||||
COPY --from=eressea /eressea/server/ /eressea/server/
|
||||
COPY --from=eressea /eressea/server/etc/report-mail.de.txt /eressea/template-mail/report-mail.de.txt
|
||||
COPY --from=eressea /eressea/server/etc/report-mail.en.txt /eressea/template-mail/report-mail.en.txt
|
||||
COPY --from=eressea /eressea/git.eressea/scripts/tools /eressea/server/scripts/tools
|
||||
COPY --from=eressea /eressea/git.eressea/s/preview /eressea/server/bin/
|
||||
COPY --from=eressea /eressea/git.eressea/process/cron/run-eressea.cron /eressea/run-eressea.sh
|
||||
COPY --from=eressea /usr/games/echeck /usr/games/echeck
|
||||
COPY --from=eressea /usr/share/locale/de/LC_MESSAGES/ /usr/share/locale/de/LC_MESSAGES/
|
||||
COPY --from=eressea /usr/share/games/echeck/ /usr/share/games/echeck/
|
||||
|
29
docker-assets/run-eressea.cron.patch
Normal file
29
docker-assets/run-eressea.cron.patch
Normal file
@ -0,0 +1,29 @@
|
||||
--- /eressea/server/bin/run-eressea.cron 2020-12-12 15:09:21.000000000 +0000
|
||||
+++ /eressea/run-eressea.sh 2020-12-07 21:09:58.000000000 +0000
|
||||
@@ -1,7 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
+# this script is based on run-eressea.cron
|
||||
+# differences to original
|
||||
+# it is possible to run a turn with empty orders
|
||||
+
|
||||
eval "$(luarocks path)"
|
||||
GAME=$1
|
||||
+ENABLE_EMPTY_ORDERS=$2
|
||||
(
|
||||
[ "$ENABLED" == "no" ] && exit
|
||||
[ -z "$ERESSEA" ] && ERESSEA="$HOME/eressea"
|
||||
@@ -27,8 +32,10 @@
|
||||
|
||||
"$BIN/create-orders" "$GAME" "$TURN"
|
||||
if [ ! -s "$ERESSEA/game-$GAME/orders.$TURN" ]; then
|
||||
- echo "server did not create orders for turn $TURN in game $GAME"
|
||||
- exit 2
|
||||
+ if [ "$ENABLE_EMPTY_ORDERS" != "yes" ]; then
|
||||
+ echo "server did not create orders for turn $TURN in game $GAME"
|
||||
+ exit 2
|
||||
+ fi
|
||||
fi
|
||||
|
||||
"$BIN/backup-eressea" "$GAME" "$TURN"
|
||||
|
@ -1,62 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# this script is based on run-eressea.cron
|
||||
# differences to original
|
||||
# it is possible to run a turn with empty orders
|
||||
|
||||
eval "$(luarocks path)"
|
||||
GAME=$1
|
||||
ENABLE_EMPTY_ORDERS=$2
|
||||
(
|
||||
[ "$ENABLED" == "no" ] && exit
|
||||
[ -z "$ERESSEA" ] && ERESSEA="$HOME/eressea"
|
||||
|
||||
export ERESSEA
|
||||
BIN="$ERESSEA/server/bin"
|
||||
TURN=$(cat "$ERESSEA/game-$GAME/turn")
|
||||
if [ ! -e "$ERESSEA/game-$GAME/data/$TURN.dat" ]; then
|
||||
echo "data file $TURN is missing, cannot run turn for game $GAME"
|
||||
exit 1
|
||||
fi
|
||||
REPORTS="$ERESSEA/game-$GAME/reports"
|
||||
if [ -d "$REPORTS" ]; then
|
||||
rm -rf "$REPORTS"
|
||||
fi
|
||||
mkdir "$REPORTS"
|
||||
|
||||
cd "$ERESSEA/game-$GAME" || exit
|
||||
|
||||
if [ -d test ]; then
|
||||
touch test/execute.lock
|
||||
fi
|
||||
|
||||
"$BIN/create-orders" "$GAME" "$TURN"
|
||||
if [ ! -s "$ERESSEA/game-$GAME/orders.$TURN" ]; then
|
||||
if [ "$ENABLE_EMPTY_ORDERS" != "yes" ]; then
|
||||
echo "server did not create orders for turn $TURN in game $GAME"
|
||||
exit 2
|
||||
fi
|
||||
fi
|
||||
|
||||
"$BIN/backup-eressea" "$GAME" "$TURN"
|
||||
rm -f execute.lock
|
||||
"$BIN/run-turn" "$GAME" "$TURN"
|
||||
touch execute.lock
|
||||
|
||||
if [ ! -s "$REPORTS/reports.txt" ]; then
|
||||
echo "server did not create reports.txt in game $GAME"
|
||||
exit 4
|
||||
fi
|
||||
"$BIN/backup-eressea" "$GAME" "$TURN"
|
||||
let TURN=$TURN+1
|
||||
if [ ! -s "$ERESSEA/game-$GAME/data/$TURN.dat" ]; then
|
||||
echo "server did not create data for turn $TURN in game $GAME"
|
||||
exit 3
|
||||
fi
|
||||
echo "sending reports for game $GAME, turn $TURN"
|
||||
"$BIN/compress.sh" "$GAME" "$TURN"
|
||||
"$BIN/sendreports.sh" "$GAME"
|
||||
"$BIN/backup-eressea" "$GAME" "$TURN"
|
||||
rm -f test/execute.lock
|
||||
) | tee -a "$HOME/log/eressea.cron.log"
|
||||
|
@ -556,7 +556,7 @@ cmd_run() {
|
||||
get_turn
|
||||
enable_empty_orders="no"
|
||||
[ "$turn" == "0" ] && enable_empty_orders="yes"
|
||||
/eressea/run-eressea.sh 1
|
||||
/eressea/run-eressea.sh 1 $enable_empty_orders
|
||||
|
||||
cmd_shutdown
|
||||
}
|
||||
|
Reference in New Issue
Block a user