Skip to content

Commit

Permalink
Build release when tag is set
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaars committed Jun 20, 2018
1 parent 14dbd47 commit bc84e8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ deploy:
on:
repo: WebGoat/WebGoat
tags: true
branch: master
- provider: releases
skip_cleanup: true
overwrite: true
Expand All @@ -40,7 +39,6 @@ deploy:
on:
repo: WebGoat/WebGoat
tags: true
branch: master
env:
global:
#Docker login
Expand Down
8 changes: 2 additions & 6 deletions scripts/deploy-webgoat.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit bc84e8f

Please sign in to comment.