Skip to content

Commit

Permalink
ci: deploy a snapshot when the build succeed (STAMP-project#437)
Browse files Browse the repository at this point in the history
  • Loading branch information
danglotb authored May 17, 2018
1 parent e4a1964 commit 76a59f8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ install:
- export MAVEN_HOME=`mvn --version | grep 'Maven home' | sed -e 's/Maven h.* //'`

script:
- git clone https://github.com/STAMP-project/pitest-descartes && cd pitest-descartes && mvn install -DskipTests -Dgpg.skip=true && cd ..
- mvn clean install
- cd dspot && java -jar target/dspot-$DSPOT_VERSION-jar-with-dependencies.jar --example

after_success:
- mvn clean test jacoco:report coveralls:report
- mvn clean test jacoco:report coveralls:report
- cd .. && ./.travis/travis-deploy.sh

branch:
only:
- master
7 changes: 7 additions & 0 deletions .travis/travis-deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

if [ "$TRAVIS_PULL_REQUEST" = "false" ] && [ "$TRAVIS_BRANCH" = "master" ]; then
cp .travis/travis-settings.xml $HOME/.m2/settings.xml && mvn deploy -DskipTests
else
echo "Nothing to deploy when on PR or other branch"
fi
9 changes: 9 additions & 0 deletions .travis/travis-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<settings>
<servers>
<server>
<id>ossrh-dspot-snapshots</id>
<username>${env.DSPOT_USERNAME}</username>
<password>${env.DSPOT_PASSWORD}</password>
</server>
</servers>
</settings>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

<distributionManagement>
<snapshotRepository>
<id>ossrh-snapshots</id>
<id>ossrh-dspot-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
Expand Down

0 comments on commit 76a59f8

Please sign in to comment.