prophunt-garrysmod/test/testBuild.sh

32 lines
872 B
Bash
Raw Normal View History

2019-10-15 12:40:02 +02:00
#!/bin/bash
readonly SUFFIX="$1"
2021-11-08 11:28:08 +01:00
readonly BUILD_LGSM="$(grep -qF '--skip-lgsm' <<< "$@" && echo false || echo true)"
2021-11-08 18:50:15 +01:00
readonly repository="${DOCKER_REPO:-jusito/docker-ttt}"
2019-10-15 12:40:02 +02:00
if [ "${DEBUGGING}" = "true" ]; then
set -o xtrace
else
DEBUGGING="false"
fi
set -o errexit
set -o nounset
set -o pipefail
echo "[testBuild][INFO]build"
2021-11-08 11:28:08 +01:00
if "$BUILD_LGSM"; then
2021-11-08 18:19:51 +01:00
docker rmi "$repository:lgsm_debian${SUFFIX}" || true
docker build --no-cache -t "$repository:lgsm_debian${SUFFIX}" "lgsm/"
fi
2021-11-08 18:19:51 +01:00
docker rmi "$repository:gmod_debian${SUFFIX}" || true
docker build --no-cache -t "$repository:gmod_debian${SUFFIX}" "gmod/"
2019-10-15 12:40:02 +02:00
2021-11-08 18:19:51 +01:00
docker rmi "$repository:gmod_ttt_debian${SUFFIX}" || true
docker build --no-cache -t "$repository:gmod_ttt_debian${SUFFIX}" "TTT/"
2019-10-15 12:40:02 +02:00
2021-11-08 18:19:51 +01:00
docker rmi "$repository:latest${SUFFIX}" || true
docker tag "$repository:gmod_ttt_debian${SUFFIX}" "$repository:latest${SUFFIX}"