Added Travis deploy files

This commit is contained in:
Norbi Peti 2017-07-06 00:20:04 +02:00
parent c23e4db5e7
commit 9dcaaccc58
2 changed files with 37 additions and 0 deletions

26
.travis.yml Normal file
View file

@ -0,0 +1,26 @@
cache:
directories:
- $HOME/.m2/repository/org/bukkit/craftbukkit
before_install: | # Wget BuildTools and run if cached folder not found
if [ ! -d "$HOME/.m2/repository/org/bukkit/craftbukkit/1.12-R0.1-SNAPSHOT" ]; then
wget -O BuildTools.jar https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
java -jar BuildTools.jar --rev 1.12
fi
language: java
jdk:
- oraclejdk8
sudo: true
deploy:
# deploy develop to the staging environment
- provider: script
script: chmod +x deploy.sh && sh deploy.sh staging
on:
branch: dev
skip_cleanup: true
# deploy master to production
- provider: script
script: chmod +x deploy.sh && sh deploy.sh production
on:
branch: master
skip_cleanup: true

11
deploy.sh Normal file
View file

@ -0,0 +1,11 @@
#!/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
chmod 400 upload_key
yes | scp -B -i upload_key -o StrictHostKeyChecking=no $FILENAME travis@server.figytuna.com:/minecraft/main/plugins
fi