Skip to content

Commit

Permalink
allow both servername and serverid
Browse files Browse the repository at this point in the history
  • Loading branch information
zefanjajobse committed Feb 16, 2024
1 parent a510b53 commit 1d4541f
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 104 deletions.
11 changes: 9 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.75 as builder
FROM rust:1.75 AS builder
WORKDIR /usr/src/myapp
COPY . .
ARG github_token
Expand All @@ -8,11 +8,18 @@ RUN git config --global credential.helper store && echo "https://zefanjajobse:${
FROM debian:bookworm-slim

ENV token default_token_value
ENV game bf1
ENV server_name default_server_name_value
ENV server_id default_server_id_value

HEALTHCHECK --interval=5m --timeout=3s --start-period=5s \
CMD curl -f http://127.0.0.1:3030/ || exit 1

COPY --from=builder /usr/local/cargo/bin/discord_bot /usr/local/bin/discord_bot
RUN apt-get update && apt-get install --assume-yes curl && apt-get clean
CMD echo "token = '$token'\nserver_name = '$server_name'" > config.txt && discord_bot
CMD if [ "$server_name" = "default_server_name_value" ]; then\
export INFO="token = '$token'\ngame = '$game'\nserver_id = $server_id"; \
else \
export INFO="token = '$token'\ngame = '$game'\nserver_name = '$server_name'"; \
fi; \
echo $INFO > config.txt && discord_bot
6 changes: 6 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ set the config to the correct info in a config.txt next to this executable to us
```yaml
# discord bot token
token = ''
# (optional) game could be bf1 or bfv, defaults to bf1
game = ''

## use one of the options below
# servername to track
server_name = ''
# server id to track
server_id = ''
```
Binary file modified info_image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified map_mode.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 1d4541f

Please sign in to comment.