From bc84e8f207daa7afe307a982ae1fc6a0a1891fa7 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Wed, 20 Jun 2018 18:22:35 +0200 Subject: [PATCH] Build release when tag is set --- .travis.yml | 2 -- scripts/deploy-webgoat.sh | 8 ++------ 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index e0ac400743..46865c92ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,7 +28,6 @@ deploy: on: repo: WebGoat/WebGoat tags: true - branch: master - provider: releases skip_cleanup: true overwrite: true @@ -40,7 +39,6 @@ deploy: on: repo: WebGoat/WebGoat tags: true - branch: master env: global: #Docker login diff --git a/scripts/deploy-webgoat.sh b/scripts/deploy-webgoat.sh index eb9db07c8d..4115a90e8c 100644 --- a/scripts/deploy-webgoat.sh +++ b/scripts/deploy-webgoat.sh @@ -6,7 +6,7 @@ export REPO=webgoat/webgoat-8.0 cd webgoat-server ls target/ -if [ "${BRANCH}" == "master" ] && [ ! -z "${TRAVIS_TAG}" ]; then +if [ ! -z "${TRAVIS_TAG}" ]; then # If we push a tag to master this will update the LATEST Docker image and tag with the version number docker build --build-arg webgoat_version=${TRAVIS_TAG:1} -f Dockerfile -t $REPO:latest -t $REPO:${TRAVIS_TAG} . docker push $REPO @@ -27,14 +27,10 @@ cd .. cd webwolf ls target/ -if [ "${BRANCH}" == "master" ] && [ ! -z "${TRAVIS_TAG}" ]; then +if [ ! -z "${TRAVIS_TAG}" ]; then # If we push a tag to master this will update the LATEST Docker image and tag with the version number docker build --build-arg webwolf_version=${TRAVIS_TAG:1} -f Dockerfile -t $REPO:latest -t $REPO:${TRAVIS_TAG} . docker push $REPO -elif [ ! -z "${TRAVIS_TAG}" ]; then - # Creating a tag build we push it to Docker with that tag - docker build --build-arg webwolf_version=${TRAVIS_TAG:1} -f Dockerfile -t $REPO:${TRAVIS_TAG} -t $REPO:latest . - docker push $REPO else echo "Skipping releasing to DockerHub because it is a build of branch ${BRANCH}" fi \ No newline at end of file