Skip to content

Commit

Permalink
Enhancement: Update build/Dockerfile and .env INSTALL_COUNT and…
Browse files Browse the repository at this point in the history
… `STEAM_LOGIN` values (#196)
  • Loading branch information
leojonathanoh authored Feb 4, 2025
1 parent 5966e45 commit 73a507a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Generate-GitBranches.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,17 @@ try {
"Creating .env'" | Write-Host -ForegroundColor Green
}
@"
PIPELINE=update
PIPELINE=$( if ($kv.Contains('PIPELINE')) { $kv['PIPELINE'] } else { 'build' } )
GAME_UPDATE_COUNT=$( if ($kv.Contains('GAME_UPDATE_COUNT')) { $kv['GAME_UPDATE_COUNT'] } else { $g['game_update_count'] } )
GAME_VERSION=$( if ($kv.Contains('GAME_VERSION')) { $kv['GAME_VERSION'] } else { $g['game_version'] } )
APPID=$( $g['appid'] )
CLIENT_APPID=$( $g['client_appid'] )
GAME=$( $g['game'] )
MOD=$( $g['mod'] )
FIX_APPMANIFEST=
INSTALL_COUNT=$(
if ($g['game_engine'] -eq 'srcds' -and $g['game'] -eq 'cs2') { '3' } # srcds/cs2 may require multiple installs to be successful
)
LATEST=true
CACHE=
NO_CACHE=
Expand All @@ -231,7 +234,10 @@ NO_PUSH=
DOCKER_REPOSITORY=$( $g['docker_repository'] )
#REGISTRY_USER=
#REGISTRY_PASSWORD=
STEAM_LOGIN=
STEAM_LOGIN=$(
if ($g['game_engine'] -eq 'srcds' -and $g['game'] -eq 'cs2') { 'true' }
elseif ($g['game_engine'] -eq 'srcds' -and $g['game'] -eq 'tf') { 'true' }
)
#STEAM_USERNAME=
#STEAM_PASSWORD=
"@ | Out-File .env -Encoding utf8 -Force
Expand Down
5 changes: 5 additions & 0 deletions build/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ RUN --mount=type=secret,id=STEAM_USERNAME \
i=0; \
while [ "$i" -le $(( $INSTALL_COUNT-1 )) ]; do \
echo "[BUILD] Install count: [$(( i+1 ))/$INSTALL_COUNT]"; \
if [ "$i" -eq 0 ] && [ "$APPID" = 222860 ]; then \
steamcmdArgs="+force_install_dir $SERVER_DIR +login $steamcmdLoginArgs +@sSteamCmdForcePlatformType windows +app_update $APPID validate +quit"; \
steamcmd.sh $steamcmdArgs; \
steamcmdArgs="+force_install_dir $SERVER_DIR +login $steamcmdLoginArgs +@sSteamCmdForcePlatformType linux +app_update $APPID validate +quit"; \
fi; \
steamcmd.sh $steamcmdArgs; \
ls -al "$SERVER_DIR/steamapps"; \
i=$(( i+1 )); \
Expand Down

0 comments on commit 73a507a

Please sign in to comment.