diff --git a/.travis.yml b/.travis.yml index a20cdb5a..41909c29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,3 +3,10 @@ jdk: - oraclejdk8 notifications: email: false +addons: + apt: + packages: + - sshpass +script: mvn clean install +after_success: + - ./travis-upload.sh diff --git a/travis-upload.sh b/travis-upload.sh new file mode 100755 index 00000000..e0ed56cb --- /dev/null +++ b/travis-upload.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then + mv target/TotalFreedomMod.jar target/TotalFreedomMod-${TRAVIS_COMMIT}.jar + export SSHPASS=${SFTP_PASSWORD} + sshpass -e sftp -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -oLogLevel=ERROR -oBatchMode=no -b - ${SFTP_USER}@${SFTP_HOST}:${SFTP_PATH} << ! + put target/TotalFreedomMod-${TRAVIS_COMMIT}.jar + bye +! + echo "Artifact upload status: "$? +else + echo "Skipping artifact upload for pull request build." +fi