From 31ee012f12eb8a48e4c4e45ea189a707c35a91f1 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Wed, 5 Aug 2020 19:20:40 +0200 Subject: [PATCH] Adding auto deployment for web.teaspeak.de --- .travis.yml | 8 +++++++- scripts/travis/{deploy_dev_server.sh => deploy_server.sh} | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) rename scripts/travis/{deploy_dev_server.sh => deploy_server.sh} (90%) diff --git a/.travis.yml b/.travis.yml index bd5d6bb8..c3407834 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,13 @@ jobs: deploy: - provider: script - script: "bash scripts/travis/deploy_dev_server.sh" + script: "bash scripts/travis/deploy_server.sh development" + cleanup: false + skip_cleanup: true + on: + branch: develop + - provider: script + script: "bash scripts/travis/deploy_server.sh production" cleanup: false skip_cleanup: true on: diff --git a/scripts/travis/deploy_dev_server.sh b/scripts/travis/deploy_server.sh similarity index 90% rename from scripts/travis/deploy_dev_server.sh rename to scripts/travis/deploy_server.sh index 5453dde2..7732106b 100644 --- a/scripts/travis/deploy_dev_server.sh +++ b/scripts/travis/deploy_server.sh @@ -1,5 +1,10 @@ #!/usr/bin/env bash +if [[ -z "$1" ]]; then + echo "Missing deploy channel" + exit 1 +fi + cd "$(dirname "$0")/../../" || { echo "Failed to enter base dir"; exit 1; } source ./scripts/travis/properties.sh @@ -41,5 +46,5 @@ _exit_code=$? echo "Failed to upload the .zip file ($_exit_code)" exit 1 } -ssh -oStrictHostKeyChecking=no -oIdentitiesOnly=yes -i /tmp/sftp_key TeaSpeak-Travis-Web@web.teaspeak.dev "./unpack.sh tmp-upload/$filename" +ssh -oStrictHostKeyChecking=no -oIdentitiesOnly=yes -i /tmp/sftp_key TeaSpeak-Travis-Web@web.teaspeak.dev "./unpack.sh $1 tmp-upload/$filename" exit $? \ No newline at end of file