fix docker ci
This commit is contained in:
parent
5264cfe4c0
commit
77383c4b7d
@ -10,8 +10,4 @@ fi
|
||||
|
||||
cd ..
|
||||
|
||||
bash test/testBuild.sh "$imageSuffix"
|
||||
|
||||
docker push "$DOCKER_REPO:gmod_debian${imageSuffix}"
|
||||
docker push "$DOCKER_REPO:gmod_ttt_debian${imageSuffix}"
|
||||
docker push "$DOCKER_REPO:latest${imageSuffix}"
|
||||
bash test/testBuild.sh "$imageSuffix" --push
|
||||
|
@ -1,7 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
readonly SUFFIX="$1"
|
||||
readonly BUILD_LGSM="$(grep -qF '--skip-lgsm' <<< "$@" && echo false || echo true)"
|
||||
readonly BUILD_LGSM="$(grep -qF -e '--skip-lgsm' <<< "$@" && echo false || echo true)"
|
||||
readonly PUSH="$(grep -qF -e '--push' <<< "$@" && echo true || echo false)"
|
||||
readonly repository="${DOCKER_REPO:-jusito/docker-ttt}"
|
||||
|
||||
if [ "${DEBUGGING}" = "true" ]; then
|
||||
@ -14,18 +15,27 @@ set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
function process() {
|
||||
tag_prefix="$1"
|
||||
subdir="$2"
|
||||
|
||||
docker rmi "$repository:$tag_prefix${SUFFIX}" || true
|
||||
docker build --no-cache -t "$repository:$tag_prefix${SUFFIX}" "$subdir"
|
||||
if "$PUSH"; then
|
||||
docker push "$repository:$tag_prefix${SUFFIX}"
|
||||
fi
|
||||
}
|
||||
|
||||
echo "[testBuild][INFO]build"
|
||||
|
||||
if "$BUILD_LGSM"; then
|
||||
docker rmi "$repository:lgsm_debian${SUFFIX}" || true
|
||||
docker build --no-cache -t "$repository:lgsm_debian${SUFFIX}" "lgsm/"
|
||||
process "lgsm_debian" "lgsm/"
|
||||
fi
|
||||
|
||||
docker rmi "$repository:gmod_debian${SUFFIX}" || true
|
||||
docker build --no-cache -t "$repository:gmod_debian${SUFFIX}" "gmod/"
|
||||
|
||||
docker rmi "$repository:gmod_ttt_debian${SUFFIX}" || true
|
||||
docker build --no-cache -t "$repository:gmod_ttt_debian${SUFFIX}" "TTT/"
|
||||
process "gmod_debian" "gmod/"
|
||||
process "gmod_ttt_debian" "TTT/"
|
||||
|
||||
docker rmi "$repository:latest${SUFFIX}" || true
|
||||
docker tag "$repository:gmod_ttt_debian${SUFFIX}" "$repository:latest${SUFFIX}"
|
||||
if "$PUSH"; then
|
||||
docker push "$repository:lgsm_debian${SUFFIX}"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user