forked from github/server
Merge branch 'develop' of https://github.com/ennorehling/eressea.git
This commit is contained in:
commit
7867eb6962
|
@ -14,6 +14,7 @@ addons:
|
||||||
- libxml2-dev
|
- libxml2-dev
|
||||||
- valgrind
|
- valgrind
|
||||||
- cppcheck
|
- cppcheck
|
||||||
|
- shellcheck
|
||||||
os:
|
os:
|
||||||
- linux
|
- linux
|
||||||
notifications:
|
notifications:
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
SCRIPTS=compress.sh send-bz2-report send-zip-report create-orders \
|
||||||
|
run-turn sendreports.sh
|
||||||
|
IGNORE=sendreport.sh
|
||||||
|
|
||||||
|
shellcheck: $(SCRIPTS)
|
||||||
|
shellcheck $(SCRIPTS)
|
|
@ -1,24 +1,25 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
if [ -z $ERESSEA ]; then
|
if [ -z "$ERESSEA" ]; then
|
||||||
echo "You need to define the \$ERESSEA environment variable to run $0"
|
echo "You need to define the \$ERESSEA environment variable to run $0"
|
||||||
exit -2
|
exit -2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GAME=$ERESSEA/game-$1
|
GAME="$ERESSEA/game-$1"
|
||||||
GAME_NAME=$(grep -w name $GAME/eressea.ini | sed 's/.*=\s*//')
|
GAME_NAME=$(grep -w name "$GAME/eressea.ini" | sed 's/.*=\s*//')
|
||||||
|
|
||||||
TURN=$2
|
TURN=$2
|
||||||
if [ -z $TURN ]
|
if [ -z "$TURN" ]
|
||||||
then
|
then
|
||||||
TURN=`cat $GAME/turn`
|
TURN=$(cat "$GAME/turn")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -d $GAME/reports ]; then
|
if [ ! -d "$GAME/reports" ]; then
|
||||||
echo "cannot find reports directory in $GAME"
|
echo "cannot find reports directory in $GAME"
|
||||||
exit -1
|
exit -1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $GAME/reports
|
cd "$GAME/reports" || exit
|
||||||
$ERESSEA/server/bin/compress.py $TURN "$GAME_NAME"
|
"$ERESSEA/server/bin/compress.py" "$TURN" "$GAME_NAME"
|
||||||
cd -
|
cd - || exit
|
||||||
|
|
||||||
|
|
|
@ -3,26 +3,25 @@
|
||||||
GAME=$1
|
GAME=$1
|
||||||
TURN=$2
|
TURN=$2
|
||||||
|
|
||||||
if [ ! -d $ERESSEA/game-$GAME ] ; then
|
if [ ! -d "$ERESSEA/game-$GAME" ] ; then
|
||||||
echo "No such game: $GAME"
|
echo "No such game: $GAME"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $ERESSEA/game-$GAME
|
cd "$ERESSEA/game-$GAME" || exit
|
||||||
|
|
||||||
if [ -d orders.dir.$TURN ]; then
|
if [ -d "orders.dir.$TURN" ]; then
|
||||||
echo "orders.dir.$TURN already exists"
|
echo "orders.dir.$TURN already exists"
|
||||||
else
|
else
|
||||||
mv orders.dir orders.dir.$TURN
|
mv orders.dir "orders.dir.$TURN"
|
||||||
mkdir -p orders.dir
|
mkdir -p orders.dir
|
||||||
fi
|
fi
|
||||||
ls -1rt orders.dir.$TURN/turn-* | xargs cat > orders.$TURN
|
ls -1rt "orders.dir.$TURN/turn-*" | xargs cat > "orders.$TURN"
|
||||||
|
|
||||||
lockfile -r3 -l120 orders.queue.lock
|
lockfile -r3 -l120 orders.queue.lock
|
||||||
if [ -e orders.queue ] ; then
|
if [ -e orders.queue ] ; then
|
||||||
mv orders.queue orders.dir.$TURN/orders.queue
|
mv orders.queue "orders.dir.$TURN/orders.queue"
|
||||||
fi
|
fi
|
||||||
rm -f orders.queue.lock
|
rm -f orders.queue.lock
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
GAME=$1
|
GAME="$1"
|
||||||
TURN=$2
|
TURN="$2"
|
||||||
|
|
||||||
if [ ! -d $ERESSEA/game-$GAME ] ; then
|
if [ ! -d "$ERESSEA/game-$GAME" ] ; then
|
||||||
echo "No such game: $GAME"
|
echo "No such game: $GAME"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $ERESSEA/game-$GAME
|
cd "$ERESSEA/game-$GAME" || exit
|
||||||
|
|
||||||
echo "running turn $TURN, game $GAME"
|
echo "running turn $TURN, game $GAME"
|
||||||
$ERESSEA/server/bin/eressea -v3 -t $TURN run-turn.lua
|
"$ERESSEA/server/bin/eressea" -v3 -t "$TURN" run-turn.lua
|
||||||
mkdir -p log
|
mkdir -p log
|
||||||
ln -f eressea.log log/eressea.log.$TURN
|
ln -f eressea.log "log/eressea.log.$TURN"
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,12 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [ -z $ERESSEA ]; then
|
if [ -z "$ERESSEA" ]; then
|
||||||
ERESSEA=`echo $PWD |sed -e 's/\/game.*//'`
|
ERESSEA=$(echo "$PWD" |sed -e 's/\/game.*//')
|
||||||
echo "Assuming that ERESSEA=$ERESSEA"
|
echo "Assuming that ERESSEA=$ERESSEA"
|
||||||
fi
|
fi
|
||||||
if [ ! -f reports.txt ]; then
|
if [ ! -f reports.txt ]; then
|
||||||
echo "need to run $0 from the report direcory"
|
echo "need to run $0 from the report direcory"
|
||||||
exit -2
|
exit -2
|
||||||
fi
|
fi
|
||||||
source $HOME/bin/functions.sh
|
|
||||||
|
|
||||||
TEMPLATE=report-mail.txt
|
TEMPLATE=report-mail.txt
|
||||||
if [ "$1" == "-Lde" ]
|
if [ "$1" == "-Lde" ]
|
||||||
|
@ -26,4 +25,6 @@ addr=$1
|
||||||
subj=$2
|
subj=$2
|
||||||
shift 2
|
shift 2
|
||||||
|
|
||||||
cat $ERESSEA/server/etc/$TEMPLATE | mutt -F $ERESSEA/etc/muttrc -s "$subj" -a $* -- $addr
|
mutt -F "$ERESSEA/etc/muttrc" -s "$subj" -a "$@" -- "$addr" \
|
||||||
|
< "$ERESSEA/server/etc/$TEMPLATE"
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
if [ -z $ERESSEA ]; then
|
|
||||||
ERESSEA=`echo $PWD |sed -e 's/\/game.*//'`
|
if [ -z "$ERESSEA" ]; then
|
||||||
|
ERESSEA=$(echo "$PWD" |sed -e 's/\/game.*//')
|
||||||
echo "Assuming that ERESSEA=$ERESSEA"
|
echo "Assuming that ERESSEA=$ERESSEA"
|
||||||
fi
|
fi
|
||||||
if [ ! -f reports.txt ]; then
|
if [ ! -f reports.txt ]; then
|
||||||
|
@ -9,7 +10,7 @@ if [ ! -f reports.txt ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PWD=$(pwd)
|
PWD=$(pwd)
|
||||||
GAME=$(dirname $PWD)
|
GAME=$(dirname "$PWD")
|
||||||
|
|
||||||
TEMPLATE=report-mail.txt
|
TEMPLATE=report-mail.txt
|
||||||
if [ "$1" == "-Lde" ]
|
if [ "$1" == "-Lde" ]
|
||||||
|
@ -24,13 +25,13 @@ then
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -e $GAME/$TEMPLATE ]; then
|
if [ -e "$GAME/$TEMPLATE" ]; then
|
||||||
TEMPLATE=$GAME/$TEMPLATE
|
TEMPLATE="$GAME/$TEMPLATE"
|
||||||
else
|
else
|
||||||
TEMPLATE=$ERESSEA/server/etc/$TEMPLATE
|
TEMPLATE="$ERESSEA/server/etc/$TEMPLATE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -e $TEMPLATE ]; then
|
if [ ! -e "$TEMPLATE" ]; then
|
||||||
echo "no such email template: $TEMPLATE"
|
echo "no such email template: $TEMPLATE"
|
||||||
exit -3
|
exit -3
|
||||||
fi
|
fi
|
||||||
|
@ -42,8 +43,7 @@ done
|
||||||
addr=$1
|
addr=$1
|
||||||
subject=$2
|
subject=$2
|
||||||
shift 2
|
shift 2
|
||||||
mutt -F $ERESSEA/etc/muttrc -s "$subject" -a $* -- $addr < $TEMPLATE
|
|
||||||
|
|
||||||
if [ $? -ne 0 ] ; then
|
mutt -F "$ERESSEA/etc/muttrc" -s "$subject" -a "$@" -- "$addr" \
|
||||||
echo "Sending failed for email/report: $2/$3"
|
< "$TEMPLATE" || echo "Sending failed for email/report: $2/$3"
|
||||||
fi
|
|
||||||
|
|
|
@ -3,30 +3,23 @@
|
||||||
##
|
##
|
||||||
## Prepare the report
|
## Prepare the report
|
||||||
|
|
||||||
if [ -z $ERESSEA ]; then
|
if [ -z "$ERESSEA" ]; then
|
||||||
echo "You have to define the \$ERESSEA environment variable to run $0"
|
echo "You have to define the \$ERESSEA environment variable to run $0"
|
||||||
exit -2
|
exit -2
|
||||||
fi
|
fi
|
||||||
source $HOME/bin/functions.sh
|
|
||||||
|
|
||||||
if [ ! -z $1 ]; then
|
if [ ! -z "$1" ]; then
|
||||||
GAME=$ERESSEA/game-$1
|
GAME="$ERESSEA/game-$1"
|
||||||
else
|
else
|
||||||
GAME=$ERESSEA
|
GAME=$ERESSEA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd $GAME/reports || abort "could not chdir to reports directory"
|
cd "$GAME/reports" || exit
|
||||||
for REPORT in *.sh
|
for REPORT in *.sh
|
||||||
do
|
do
|
||||||
echo -n "Sending "
|
echo -n "Sending "
|
||||||
basename $REPORT .sh
|
basename "$REPORT" .sh
|
||||||
bash $REPORT
|
bash "$REPORT"
|
||||||
done
|
done
|
||||||
cd -
|
cd - || exit
|
||||||
|
|
||||||
if [ -e $GAME/ages.sh ]; then
|
|
||||||
cd $GAME
|
|
||||||
./ages.sh
|
|
||||||
cd -
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
|
@ -26,4 +26,6 @@ cppcheck --version
|
||||||
cppcheck --quiet --error-exitcode=1 src
|
cppcheck --quiet --error-exitcode=1 src
|
||||||
s/runtests -V
|
s/runtests -V
|
||||||
integration_tests
|
integration_tests
|
||||||
|
cd ../process
|
||||||
|
make
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue