Skip to content

Commit 73a507a

Browse files
Enhancement: Update build/Dockerfile and .env INSTALL_COUNT and STEAM_LOGIN values (#196)
1 parent 5966e45 commit 73a507a

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Generate-GitBranches.ps1

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,14 +214,17 @@ try {
214214
"Creating .env'" | Write-Host -ForegroundColor Green
215215
}
216216
@"
217-
PIPELINE=update
217+
PIPELINE=$( if ($kv.Contains('PIPELINE')) { $kv['PIPELINE'] } else { 'build' } )
218218
GAME_UPDATE_COUNT=$( if ($kv.Contains('GAME_UPDATE_COUNT')) { $kv['GAME_UPDATE_COUNT'] } else { $g['game_update_count'] } )
219219
GAME_VERSION=$( if ($kv.Contains('GAME_VERSION')) { $kv['GAME_VERSION'] } else { $g['game_version'] } )
220220
APPID=$( $g['appid'] )
221221
CLIENT_APPID=$( $g['client_appid'] )
222222
GAME=$( $g['game'] )
223223
MOD=$( $g['mod'] )
224224
FIX_APPMANIFEST=
225+
INSTALL_COUNT=$(
226+
if ($g['game_engine'] -eq 'srcds' -and $g['game'] -eq 'cs2') { '3' } # srcds/cs2 may require multiple installs to be successful
227+
)
225228
LATEST=true
226229
CACHE=
227230
NO_CACHE=
@@ -231,7 +234,10 @@ NO_PUSH=
231234
DOCKER_REPOSITORY=$( $g['docker_repository'] )
232235
#REGISTRY_USER=
233236
#REGISTRY_PASSWORD=
234-
STEAM_LOGIN=
237+
STEAM_LOGIN=$(
238+
if ($g['game_engine'] -eq 'srcds' -and $g['game'] -eq 'cs2') { 'true' }
239+
elseif ($g['game_engine'] -eq 'srcds' -and $g['game'] -eq 'tf') { 'true' }
240+
)
235241
#STEAM_USERNAME=
236242
#STEAM_PASSWORD=
237243
"@ | Out-File .env -Encoding utf8 -Force

build/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ RUN --mount=type=secret,id=STEAM_USERNAME \
6060
i=0; \
6161
while [ "$i" -le $(( $INSTALL_COUNT-1 )) ]; do \
6262
echo "[BUILD] Install count: [$(( i+1 ))/$INSTALL_COUNT]"; \
63+
if [ "$i" -eq 0 ] && [ "$APPID" = 222860 ]; then \
64+
steamcmdArgs="+force_install_dir $SERVER_DIR +login $steamcmdLoginArgs +@sSteamCmdForcePlatformType windows +app_update $APPID validate +quit"; \
65+
steamcmd.sh $steamcmdArgs; \
66+
steamcmdArgs="+force_install_dir $SERVER_DIR +login $steamcmdLoginArgs +@sSteamCmdForcePlatformType linux +app_update $APPID validate +quit"; \
67+
fi; \
6368
steamcmd.sh $steamcmdArgs; \
6469
ls -al "$SERVER_DIR/steamapps"; \
6570
i=$(( i+1 )); \

0 commit comments

Comments
 (0)