update and add testing build
vintage-story-build-latest / Docker prune (vm-docker-build2) (push) Successful in 3s
vintage-story-build-testing / Docker prune (vm-docker-build2) (push) Successful in 3s
vintage-story-build-latest / poll-debian-base-and-detect-changes (push) Successful in 7s
vintage-story-build-testing / poll-debian-base-and-detect-changes (push) Successful in 7s
vintage-story-build-latest / Build and Push latest (push) Successful in 32s
vintage-story-build-testing / Build and Push testing (push) Successful in 30s
vintage-story-build-latest / generate-changelogs (push) Successful in 8s
vintage-story-build-testing / generate-changelogs (push) Successful in 10s
vintage-story-build-latest / generate-build-info (push) Successful in 10s
vintage-story-build-testing / generate-build-info (push) Successful in 10s

This commit is contained in:
2026-07-28 11:54:00 -07:00
parent 68d63fec74
commit e8dc20eacc
7 changed files with 583 additions and 24 deletions
+32
View File
@@ -0,0 +1,32 @@
FROM gitea.fithwum.tech/fithwum/debian-base:bookworm
LABEL maintainer="fithwum"
# Environment Variables
ENV VS_CHANNEL=""
ENV VS_VERSION=""
ENV DOTNET_VERSION=""
# URL's for files
ARG INSTALL_SCRIPT=https://gitea.fithwum.tech/fithwum/vintage-story/raw/branch/main/testing/install_script.sh
# Install Dependencies.
RUN apt-get -y update && apt-get autoclean && apt-get autoremove \
&& apt-get -y update && apt-get install -y bzip2 jq wget procps pcregrep screen \
&& adduser vintagestory \
&& apt-get -y --fix-broken install \
&& rm -rf /var/lib/apt/lists/* \
&& update-ca-certificates -f;
# Folder creation.
RUN mkdir -p /vs_server /vs_server/server /vs_server/server/data /vstemp /vstemp/files \
&& chmod 777 -R /vs_server /vstemp \
&& chown 99:100 -R /vs_server /vstemp
RUN wget --no-cache "$INSTALL_SCRIPT" -O /vstemp/install_script.sh \
&& chmod +x /vstemp/install_script.sh
# Directory where data is stored
VOLUME /vs_server
# Run command
CMD [ "/bin/bash", "./vstemp/install_script.sh" ]
+129
View File
@@ -0,0 +1,129 @@
#!/bin/bash
# Copyright (c) 2026 fithwum
# All rights reserved
VS_SERVER_DIR=/vs_server/server
VS_DATA_DIR=/vs_server/server/data
LOG_FILE=$VS_DATA_DIR/Logs/server-main.log
MARKER_FILE=$VS_SERVER_DIR/.setup_done
START_FILE_1=$VS_SERVER_DIR/server-$VS_VERSION.sh
START_FILE_2=https://gitea.fithwum.tech/fithwum/vintage-story/raw/branch/main/testing/start.sh
VS_SERVER_FILE=https://cdn.vintagestory.at/gamefiles/$VS_CHANNEL/vs_server_linux-x64_$VS_VERSION.tar.gz
MS_REPO_URL=https://packages.microsoft.com/config/debian/12/packages-microsoft-prod.deb
USERNAME=adduser vintagestory
# DOTnet install
if [ $DOTNET_VERSION = "8.0" ]; then
echo "INFO ! dotnet-sdk-$DOTNET_VERSION Selected"
if [ dpkg -s dotnet-sdk-8.0 &> /dev/null ]
then
echo "INFO ! dotnet-sdk-8.0 installed ... moving on."
else
echo " "
echo "WARNING ! dotnet-sdk-8.0 not installed ... will install now."
wget --no-cache --show-progress --progress=bar:force:noscroll $MS_REPO_URL -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt-get -y update
apt-get install -y dotnet-sdk-8.0
fi
elif [ $DOTNET_VERSION = "9.0" ]; then
echo "INFO ! dotnet-sdk-$DOTNET_VERSION Selected"
if [ dpkg -s dotnet-sdk-9.0 &> /dev/null ]
then
echo "INFO ! dotnet-sdk-9.0 installed ... moving on."
else
echo " "
echo "WARNING ! dotnet-sdk-9.0 not installed ... will install now."
wget --no-cache --show-progress --progress=bar:force:noscroll $MS_REPO_URL -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt-get -y update
apt-get install -y dotnet-sdk-9.0
fi
elif [ $DOTNET_VERSION = "10.0" ]; then
echo "INFO ! dotnet-sdk-$DOTNET_VERSION Selected"
if [ dpkg -s dotnet-sdk-10.0 &> /dev/null ]
then
echo "INFO ! dotnet-sdk-10.0 installed ... moving on."
else
echo " "
echo "WARNING ! dotnet-sdk-10.0 not installed ... will install now."
wget --no-cache --show-progress --progress=bar:force:noscroll $MS_REPO_URL -O packages-microsoft-prod.deb
dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
apt-get -y update
apt-get install -y dotnet-sdk-10.0
fi
else
echo "ERROR ! Dotnet version must be set first run"
sleep infinity
fi
# Main install (Debian).
# Check for server files and download if needed.
if [ -e $START_FILE_1 ]
then
echo " "
echo "INFO ! server-$VS_VERSION.sh found starting now."
else
echo " "
echo "WARNING ! server-$VS_VERSION.sh is out of date/missing ... will download now."
echo " "
echo "INFO ! Cleaning old files."
mkdir -pv $VS_SERVER_DIR/old-server-versions/
mv *.sh $VS_SERVER_DIR/old-server-versions/
rm -fr $VS_SERVER_DIR/assets $VS_SERVER_DIR/Lib $VS_SERVER_DIR/Mods
rm -fr $VS_SERVER_DIR/VintagestoryServer $VS_SERVER_DIR/*.dll $VS_SERVER_DIR/*.pdb $VS_SERVER_DIR/*.json $VS_SERVER_DIR/*.xml $VS_SERVER_DIR/*.txt
wget --no-cache --show-progress --progress=bar:force:noscroll $VS_SERVER_FILE -O /vstemp/vs_server_linux-x64_$VS_VERSION.tar.gz
tar -xzf /vstemp/vs_server_linux-x64_$VS_VERSION.tar.gz -C /vstemp/files
rm -fr /vstemp/*.tar.gz
mv -uf /vstemp/files/* $VS_SERVER_DIR/
mv $VS_SERVER_DIR/server.sh $START_FILE_1
chmod +x $START_FILE_1
fi
echo "INFO ! Setting server path."
sed -i -E "s|^VSPATH='/home/vintagestory/server'|VSPATH='$VS_SERVER_DIR'|" $START_FILE_1
echo "INFO ! Setting data path."
sed -i -E "s|^DATAPATH='/var/vintagestory/data'|DATAPATH='$VS_DATA_DIR'|" $START_FILE_1
# Set permissions.
chown 99:100 -R $VS_SERVER_DIR
chmod 776 -R $VS_SERVER_DIR
# Setup the server
if [ ! -f $MARKER_FILE ]; then
echo "First time run: Setting up server environment..."
yes y | $VS_SERVER_DIR/server-1.21.5.sh setup $USERNAME $VS_DATA_DIR
touch $MARKER_FILE
echo "Setup successfully completed."
fi
# Download the start file for the screen session
if [ -f $START_FILE_2 ]; then
echo "INFO ! start.sh found ... moving on."
else
echo "WARNING ! start.sh missing ... downloading default file."
wget --no-cache --show-progress --progress=bar:force:noscroll $START_FILE_2 -O $VS_SERVER_DIR/start.sh
chmod +x $VS_SERVER_DIR/start.sh
fi
# Run vintage-story server.
exec $VS_SERVER_DIR/start.sh
# echo " "
# echo "INFO ! Starting vintage-story Server $VS_VERSION"
# .$START_FILE_1 start
# echo "Waiting for the server log file to be created..."
# # Loop indefinitely until the log file actually exists on disk
# until [ -f "$LOG_FILE" ]; do
# sleep 1
# done
# echo "Log file found! Streaming server console now..."
# # Hand off PID 1 to tail, keeping the container active permanently
# exec tail -f "$LOG_FILE"
exit
+29
View File
@@ -0,0 +1,29 @@
#!/bin/bash
# Copyright (c) 2026 fithwum
# All rights reserved
LOG_FILE=/vs_server/server/data/Logs/server-main.log
SESSION=server
echo "INFO ! A screen session for the Vintage-Story server is already running."
cleanup() {
echo "[INFO] Stopping Vintage-Story ..."
screen -S "$SESSION" -X $SESSION "stop$(printf '\r')"
# Wait up to 60 seconds
for i in {1..60}; do
if ! screen -list | grep -q "$SESSION"; then
break
fi
sleep 1
done
# Kill it if it's still alive
screen -S "$SESSION" -X quit 2>/dev/null || true
exit 0
}
trap cleanup SIGINT SIGTERM
# Start the Minecraft server in a detached screen session
echo "INFO ! Starting Vintage-Story Server in a screen session."
touch "$LOG_FILE"
screen -L -Logfile "$LOG_FILE" -dmS "$SESSION" bash -c dotnet /vs_server/server/VintagestoryServer.dll --data-path /vs_server/server/data
exec tail -F "$LOG_FILE"