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