Skip to content

Commit

Permalink
CI: Autobuild Repo
Browse files Browse the repository at this point in the history
  • Loading branch information
bskrtich-ci committed May 10, 2023
1 parent 73c8ed1 commit 6b60c19
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Docker Images are avaiable on [ghcr.io](https://github.com/beardedio/terraria/pk
* vanilla-1.4.3.6 [(containers/vanilla/1.4.3.6/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/vanilla/1.4.3.6/Dockerfile)
* vanilla-1.4.2.3 [(containers/vanilla/1.4.2.3/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/vanilla/1.4.2.3/Dockerfile)
* vanilla-1.4.1.2 [(containers/vanilla/1.4.1.2/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/vanilla/1.4.1.2/Dockerfile)
* tshock-5.1.3, tshock-latest [(containers/tshock/5.1.3/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.1.3/Dockerfile)
* tshock-5.2.0, tshock-latest [(containers/tshock/5.2.0/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.2.0/Dockerfile)
* tshock-5.1.3 [(containers/tshock/5.1.3/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.1.3/Dockerfile)
* tshock-5.1.2 [(containers/tshock/5.1.2/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.1.2/Dockerfile)
* tshock-5.1.1 [(containers/tshock/5.1.1/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.1.1/Dockerfile)
* tshock-5.0.0 [(containers/tshock/5.0.0/Dockerfile)](https://github.com/beardedio/terraria/blob/master/containers/tshock/5.0.0/Dockerfile)
Expand Down
44 changes: 44 additions & 0 deletions containers/tshock/5.2.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM mcr.microsoft.com/dotnet/runtime:6.0

# Update and install needed utils
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y curl nuget vim zip && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Create symbolic link to ServerLog.txt
RUN mkdir /config /tshock && \
touch /config/ServerLog.txt && \
ln -s /config/ServerLog.txt /tshock/ServerLog.txt && \
rm -rf /config

# fix for favorites.json error
RUN favorites_path="/root/My Games/Terraria" && mkdir -p "$favorites_path" && echo "{}" > "$favorites_path/favorites.json"

RUN cd /tmp && \
curl -sL https://github.com/Pryaxis/TShock/releases/download/v5.2.0/TShock-5.2-for-Terraria-1.4.4.9-linux-x64-Release.zip --output tshock_release.zip && \
unzip tshock_release.zip -d /tmp/tshock && \
cd /tmp/tshock && \
mkdir ./untar && tar -xf *.tar -C ./untar && \
cd $(find . -type f -name TShock.Server -printf '%h\n') && \
mv ./* /tshock/ && \
rm -R /tmp/*

COPY run-tshock.sh /tshock/run.sh

# Metadata
ARG VCS_REF
LABEL org.label-schema.vcs-ref=$VCS_REF
LABEL org.label-schema.vcs-url="https://github.com/beardedio/terraria"
LABEL org.opencontainers.image.source=https://github.com/beardedio/terraria
LABEL org.opencontainers.image.licenses=MIT
LABEL org.opencontainers.image.description="Tshock Terraria Server - Version 5.2.0"
LABEL TSHOCK_VERSION=5.2.0

# Allow for external data
VOLUME ["/config", "/tshock/ServerPlugins"]

# Run the server
WORKDIR /tshock
ENTRYPOINT ["./run.sh"]
16 changes: 16 additions & 0 deletions containers/tshock/5.2.0/run-tshock.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -euo pipefail

CMD="./TShock.Server -configpath /config -worldpath /config -worldselectpath /config -logpath /config"

# Pass in world if set
if [ "${world:-null}" != null ]; then
if [ ! -f "/config/$world" ]; then
echo "World file does not exist! Quitting..."
exit 1
fi
CMD="$CMD -world /config/$world"
fi

echo "Starting container, CMD: $CMD $@"
exec $CMD $@
2 changes: 1 addition & 1 deletion containers/tshock/latest
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.3
5.2.0

0 comments on commit 6b60c19

Please sign in to comment.