Feature/autobuild branch specific (#5)

docker ci will create tag depending on source branch
This commit is contained in:
jusito
2020-09-27 21:32:03 +02:00
committed by GitHub
parent 0415e30719
commit f516b8df91
5 changed files with 35 additions and 20 deletions

View File

@ -1,17 +1,19 @@
#!/bin/sh
#set -o errexit
set -o errexit
#set -o pipefail
#set -o nounset
set -o nounset
#docker build -t "$DOCKER_REPO:lgsm_debian" "lgsm/"
imageSuffix=""
if [ "$SOURCE_BRANCH" != "master" ]; then
imageSuffix="-$(echo "$SOURCE_BRANCH" | sed 's/\//-/g')"
fi
#docker build -t "$DOCKER_REPO:lgsm_debian${imageSuffix}" "lgsm/"
cd ..
docker build -t "$DOCKER_REPO:gmod_debian" "gmod/"
docker build -t "$DOCKER_REPO:gmod_ttt_debian" "TTT/"
docker tag "$DOCKER_REPO:gmod_ttt_debian" "$DOCKER_REPO:latest"
docker push "$DOCKER_REPO:gmod_debian"
docker push "$DOCKER_REPO:gmod_ttt_debian"
docker push "$DOCKER_REPO:latest"
bash test/testBuild.sh "$imageSuffix" true
docker push "$DOCKER_REPO:gmod_debian${imageSuffix}"
docker push "$DOCKER_REPO:gmod_ttt_debian${imageSuffix}"
docker push "$DOCKER_REPO:latest${imageSuffix}"