Skip to content

Commit

Permalink
Enhancement (ci): Add NO_CACHE env var
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Nov 27, 2023
1 parent 4488fd4 commit 0f18e85
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
7 changes: 7 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ usage() {
echo " CACHE Whether to pull the game image by the :latest tag before build"
echo " Type: bool, optional"
echo " Possible values: 'true', 'false'"
echo " NO_CACHE Whether to use --no-cache for docker build"
echo " Type: bool, optional"
echo " Possible values: 'true', 'false'"
echo " NO_PULL Whether to skip pulling the game image by the :latest image before build. Applies only to PIPELINE=update"
echo " Type: bool, optional"
echo " Possible values: 'true', 'false'"
Expand Down Expand Up @@ -130,6 +133,7 @@ if [ "$PIPELINE" = 'build' ]; then
INSTALL_COUNT=${INSTALL_COUNT:-}
LATEST=${LATEST:-}
CACHE=${CACHE:-}
NO_CACHE=${NO_CACHE:-false}
NO_TEST=${NO_TEST:-}
NO_PUSH=${NO_PUSH:-}
STEAM_LOGIN=${STEAM_LOGIN:-}
Expand All @@ -140,6 +144,7 @@ elif [ "$PIPELINE" = 'update' ]; then
GAME_UPDATE_COUNT=${GAME_UPDATE_COUNT:?err}
INSTALL_COUNT=${INSTALL_COUNT:-}
NO_PULL=${NO_PULL:-}
NO_CACHE=${NO_CACHE:-false}
NO_TEST=${NO_TEST:-}
NO_PUSH=${NO_PUSH:-}
STEAM_LOGIN=${STEAM_LOGIN:-}
Expand Down Expand Up @@ -227,6 +232,7 @@ if [ "$PIPELINE" = 'build' ]; then
--progress plain \
--secret id=STEAM_USERNAME,env=STEAM_USERNAME \
--secret id=STEAM_PASSWORD,env=STEAM_PASSWORD \
--no-cache="$NO_CACHE" \
--build-arg APPID="$APPID" \
--build-arg MOD="$MOD" \
--build-arg FIX_APPMANIFEST="$FIX_APPMANIFEST" \
Expand Down Expand Up @@ -260,6 +266,7 @@ elif [ "$PIPELINE" = 'update' ]; then
--progress plain \
--secret id=STEAM_USERNAME,env=STEAM_USERNAME \
--secret id=STEAM_PASSWORD,env=STEAM_PASSWORD \
--no-cache="$NO_CACHE" \
--build-arg GAME_IMAGE="$GAME_IMAGE_LATEST" \
--build-arg INSTALL_COUNT="$INSTALL_COUNT" \
--build-arg STEAM_LOGIN="$STEAM_LOGIN" \
Expand Down
1 change: 1 addition & 0 deletions test/build-hlds-cstrike.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ FIX_APPMANIFEST=true
INSTALL_COUNT=
LATEST=true
CACHE=
NO_CACHE=
NO_TEST=
NO_PUSH=true
STEAM_LOGIN=true
1 change: 1 addition & 0 deletions test/build-srcds-hl2mp.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ FIX_APPMANIFEST=
INSTALL_COUNT=
LATEST=true
CACHE=
NO_CACHE=
NO_TEST=
NO_PUSH=true
STEAM_LOGIN=
1 change: 1 addition & 0 deletions test/update-hlds-cstrike.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ APPID=90
GAME=cstrike
GAME_UPDATE_COUNT=1
INSTALL_COUNT=
NO_CACHE=
NO_PULL=true
NO_TEST=
NO_PUSH=true
Expand Down
1 change: 1 addition & 0 deletions test/update-srcds-hl2mp.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ APPID=232370
GAME=hl2mp
GAME_UPDATE_COUNT=1
INSTALL_COUNT=
NO_CACHE=
NO_PULL=true
NO_TEST=
NO_PUSH=true
Expand Down

0 comments on commit 0f18e85

Please sign in to comment.