Skip to content

Commit

Permalink
Merge pull request #63 from Mercateo/travis_deploy
Browse files Browse the repository at this point in the history
enable travis auto deployment
  • Loading branch information
JoergAdler authored Jun 13, 2019
2 parents 5a17880 + 151f4d6 commit af1d281
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
language: java
install: "mvn install -DskipTests=true"
script: "mvn -e clean test jacoco:report coveralls:report"
jdk:
- oraclejdk8

before_install:
- if [ ! -z "$GPG_SECRET_KEYS" ]; then echo $GPG_SECRET_KEYS | base64 --decode | $GPG_EXECUTABLE --import; fi
- if [ ! -z "$GPG_OWNERTRUST" ]; then echo $GPG_OWNERTRUST | base64 --decode | $GPG_EXECUTABLE --import-ownertrust; fi
install: "mvn install -DskipTests=true"
script: "mvn -e clean test jacoco:report coveralls:report"
deploy:
-
provider: script
script: .travis/deploy.sh
skip_cleanup: true
on:
repo: Mercateo/rest-schemagen
branch: master
jdk: oraclejdk8
-
provider: script
script: .travis/deploy.sh
skip_cleanup: true
on:
repo: Mercateo/rest-schemagen
tags: true
jdk: oraclejdk8
9 changes: 9 additions & 0 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
if [ ! -z "$TRAVIS_TAG" ]
then
echo "on a tag -> set pom.xml <version> to $TRAVIS_TAG"
mvn --settings .travis/settings.xml org.codehaus.mojo:versions-maven-plugin:2.1:set -DnewVersion=$TRAVIS_TAG 1>/dev/null 2>/dev/null
else
echo "not on a tag -> keep snapshot version in pom.xml"
fi

mvn clean deploy --settings .travis/settings.xml -DskipTests=true -B -U
25 changes: 25 additions & 0 deletions .travis/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<!-- Maven Central Deployment -->
<id>ossrh</id>
<username>${env.SONATYPE_USERNAME}</username>
<password>${env.SONATYPE_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>ossrh</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>

0 comments on commit af1d281

Please sign in to comment.