diff --git a/.gitignore b/.gitignore index b83d222..a17d8c7 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target/ +upload_key diff --git a/.travis.yml b/.travis.yml index 9759717..a965def 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,15 @@ before_install: | # Wget BuildTools and run if cached folder not found language: java jdk: - oraclejdk8 -sudo: true # Enable after each server update +sudo: true +deploy: + # deploy develop to the staging environment + - provider: script + script: deploy.sh staging + on: + branch: dev + # deploy master to production + - provider: script + script: deploy.sh production + on: + branch: master diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..812e12a --- /dev/null +++ b/deploy.sh @@ -0,0 +1,9 @@ +#!/bin/sh +FILENAME=$(find target/ ! -name '*original*' -name '*.jar') +echo Found file: $FILENAME + +if [ $1 = 'production' ]; then +echo Production mode +echo $UPLOAD_KEY > upload_key +scp -i upload_key $FILENAME travis@server.figytuna.com:/minecraft/main/plugins +fi