Skip to content

Commit

Permalink
feat(tf2-base): make tf2.txt a template (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrappachc committed Jan 10, 2024
1 parent 6110261 commit bbf6ce9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 6 additions & 12 deletions packages/tf2-base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,13 @@ RUN useradd --home-dir $HOME --create-home --shell /bin/bash $USER
USER $USER
WORKDIR $HOME

COPY maps_to_keep .
RUN steamcmd +login anonymous +force_install_dir $SERVER_DIR +app_update $APP_ID +quit \
COPY maps_to_keep tf2.txt.template $HOME/
RUN envsubst < $HOME/tf2.txt.template > $HOME/tf2.txt \
&& steamcmd +runscript $HOME/tf2.txt \
&& find $SERVER_DIR/tf/maps -type f | grep -v "$(cat maps_to_keep)" | xargs rm -rf \
&& rm maps_to_keep

RUN mkdir $HOME/.steam/sdk32 \
&& ln -s $HOME/.steam/steamcmd/linux32/steamclient.so $HOME/.steam/sdk32/ \
&& printf "@ShutdownOnFailedCommand 1\n\
@NoPromptForPassword 1\n\
login anonymous\n\
force_install_dir ${SERVER_DIR}\n\
app_update ${APP_ID}\n\
quit" > $HOME/tf2.txt
&& rm maps_to_keep \
&& mkdir $HOME/.steam/sdk32 \
&& ln -s $HOME/.steam/steamcmd/linux32/steamclient.so $HOME/.steam/sdk32/

COPY server.cfg.template ${SERVER_DIR}/tf/cfg/server.cfg.template
COPY --from=rcon-build /build/rcon/build/rcon ${SERVER_DIR}/rcon
Expand Down
6 changes: 6 additions & 0 deletions packages/tf2-base/tf2.txt.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@ShutdownOnFailedCommand 1
@NoPromptForPassword 1
login anonymous
force_install_dir ${SERVER_DIR}
app_update ${APP_ID}
quit

0 comments on commit bbf6ce9

Please sign in to comment.