Skip to content

Commit

Permalink
Added optional ubuntu dockerfile, updated readme with debugging tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon committed Aug 10, 2024
1 parent 9eb72ee commit 773e822
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 6 deletions.
2 changes: 1 addition & 1 deletion GuildWarsPartySearch.Bot/Dependencies/Headquarter
1 change: 1 addition & 0 deletions GuildWarsPartySearch.Bot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN apk update && apk add \
ninja \
ninja-build \
alpine-sdk \
gdb \
python3 py3-pip py3-tqdm py3-pefile

WORKDIR /app
Expand Down
12 changes: 12 additions & 0 deletions GuildWarsPartySearch.Bot/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM ubuntu:latest

RUN apt-get update && \
apt-get install -y \
cmake \
ninja-build \
build-essential \
&& apt-get clean

WORKDIR /app

CMD ["sh", "-c", "while :; do sleep 2073600; done"]
1 change: 1 addition & 0 deletions GuildWarsPartySearch.Bot/Gw.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
37444
11 changes: 7 additions & 4 deletions GuildWarsPartySearch.Bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
## Debugging

Segmentation fault in docker usually means the bot failed; running manually by sshing into the server could help give more info in the console.

1. `docker run -d --restart always --name partysearchbot -v "%cd%":/app partysearchbot_alpine`
2. `docker exec -ti partysearchbot bash`
3. `./run.sh`
1. `docker rm -f partysearchbot`
2. `docker run -d --restart always --name partysearchbot -v "%cd%":/app partysearchbot_alpine`
3. `docker exec -ti partysearchbot bash`
4. `./run.sh` - this should fail with a useless segmentation fault message. Copy the command shown in the output.
5. `gdb --args <your_copied_text>` - this should open a gdb prompt for the next steps.
6. `run` - this should end up printing out `Program received signal SIGSEGV, Segmentation fault.`
6. `bt` to view the call stack, explaining the error so you can actually do something about it!
27 changes: 26 additions & 1 deletion GuildWarsPartySearch.Bot/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,17 @@ if [ ! -f $CLIENT_EXE ]; then
source build.sh
fi

echo $CLIENT_EXE
echo $EMAIL
echo $PASSWORD
echo $CHARACTER
echo $DISTRICT
echo $MAP_ID
echo $LOG_FILE
echo $BUILD_VERSION_FILE
echo $PLUGIN_EXE

RUN_CMD=$(cat <<EOF
"$CLIENT_EXE" \
-email "$EMAIL" \
-character "$CHARACTER" \
Expand All @@ -37,4 +48,18 @@ fi
-password "$PASSWORD" \
-l "$LOG_FILE" \
-file-game-version "$BUILD_VERSION_FILE" \
"$PLUGIN_EXE" 2>&1
"$PLUGIN_EXE"
EOF
)


echo "
------- Command to run:
";
echo $RUN_CMD
echo "
-------
";


bash -c "$RUN_CMD"

0 comments on commit 773e822

Please sign in to comment.