From 61720b29ea31f49f9ce826fd7561b1e63c07a0f1 Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Sat, 23 May 2020 13:40:28 +0200 Subject: [PATCH] Fix Travis script --- .travis.yml | 39 +++++++++++++++++---------------------- scripts/deploy-webgoat.sh | 7 ------- 2 files changed, 17 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 73429b6ea2..a99bf757e0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,28 +24,23 @@ before_deploy: - cp -fa $WEBWOLF_TARGET_DIR/*.jar $WEBGOAT_ARTIFACTS_FOLDER/ - echo "Contents of artifacts folder:" - ls $WEBGOAT_ARTIFACTS_FOLDER -jobs: - include: - - stage: deploy - if: branch = master AND env(TRAVIS_TAG) IS present - jdk: openjdk11 - skip_cleanup: true - script: bash scripts/deploy-webgoat.sh - on: - repo: WebGoat/WebGoat - tags: true - - stage: releases - if: branch = master AND env(TRAVIS_TAG) IS present - jdk: openjdk11 - skip_cleanup: true - overwrite: true - api_key: - secure: pJOLBnl6427PcVg/tVy/qB18JC7b8cKpffau+IP0pjdSt7KUfBdBY3QuJ7mrM65zRoVILzggLckaew2PlRmYQRdumyWlyRn44XiJ9KO4n6Bsufbz+ictB4ggtozpp9+I9IIUh1TmqypL9lhkX2ONM9dSHmyblYpAAgMuYSK8FYc= - file_glob: true - file: "$WEBGOAT_ARTIFACTS_FOLDER/*" - on: - repo: WebGoat/WebGoat - tags: true +deploy: + - provider: script + jdk: openjdk11 + skip_cleanup: true + script: bash scripts/deploy-webgoat.sh + on: + tags: true + - provider: releases + jdk: openjdk11 + skip_cleanup: true + overwrite: true + api_key: + secure: pJOLBnl6427PcVg/tVy/qB18JC7b8cKpffau+IP0pjdSt7KUfBdBY3QuJ7mrM65zRoVILzggLckaew2PlRmYQRdumyWlyRn44XiJ9KO4n6Bsufbz+ictB4ggtozpp9+I9IIUh1TmqypL9lhkX2ONM9dSHmyblYpAAgMuYSK8FYc= + file_glob: true + file: "$WEBGOAT_ARTIFACTS_FOLDER/*" + on: + tags: true env: global: #Docker login diff --git a/scripts/deploy-webgoat.sh b/scripts/deploy-webgoat.sh index ce2517255f..5498e5e9af 100644 --- a/scripts/deploy-webgoat.sh +++ b/scripts/deploy-webgoat.sh @@ -10,13 +10,6 @@ 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 -#elif [ ! -z "${TRAVIS_TAG}" ]; then -# # Creating a tag build we push it to Docker with that tag -# docker build --build-arg webgoat_version=${TRAVIS_TAG:1} -f Dockerfile -t $REPO:${TRAVIS_TAG} -t $REPO:latest . -# docker push $REPO -#elif [ "${BRANCH}" == "develop" ]; then -# docker build -f Dockerfile -t $REPO:snapshot . -# docker push $REPO else echo "Skipping releasing to DockerHub because it is a build of branch ${BRANCH}" fi