Skip to content

Commit 5f6ca2e

Browse files
committed
Update config for Travis-CI and add release deployment
1 parent 58489aa commit 5f6ca2e

1 file changed

Lines changed: 28 additions & 11 deletions

File tree

.travis.yml

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
11
# Source language and JDK version to use
22
language: java
3-
jdk: oraclejdk7
3+
jdk: oraclejdk8
44

5-
# Compile and package JAR and set build properties
6-
install: mvn package -DbuildNumber=$TRAVIS_BUILD_NUMBER -DciSystem=travis -Dcommit=${TRAVIS_COMMIT:0:7}
7-
script: echo "I am commons"
5+
# Pre-install Maven dependencies
6+
install: mvn dependency:go-offline
87

9-
# Perform steps after compilation/test success
8+
# Compile and test source
9+
script: mvn clean -DbuildNumber=$TRAVIS_BUILD_NUMBER -DciSystem=travis -Dcommit=${TRAVIS_COMMIT:0:7}
10+
11+
# Fetch resources, run deployment goal/task, and generate Javadocs and reports
1012
after_success:
11-
# Get files for use with build, namely the custom Maven settings.xml
12-
- "git clone https://github.com/flow/travis-ci-resources.git target/travis"
13-
# Check if commit is not a pull request, if repo is official, and branch is master, generate and deploy artifacts and reports
14-
- "[[ $TRAVIS_PULL_REQUEST == false ]] && [[ $TRAVIS_REPO_SLUG == flow/flow-commons ]] && [[ $TRAVIS_BRANCH == master ]] && mvn javadoc:jar source:jar cobertura:cobertura coveralls:cobertura -DserviceJobId=$TRAVIS_JOB_ID deploy --settings target/travis/settings.xml"
13+
# Get files for use with build, namely the custom Maven settings.xml and scripts
14+
- "git clone https://github.com/flow/travis-ci-resources.git $HOME/build/flow/travis"
15+
# DEVELOP: Check if commit is not a pull request, if repo is official, if branch is not master; then deploy artifacts
16+
- "[[ $TRAVIS_PULL_REQUEST == false ]] && [[ $TRAVIS_REPO_SLUG == flow/commons ]] && [[ $TRAVIS_BRANCH == develop ]] && mvn deploy --settings $HOME/build/flow/travis/settings.xml"
17+
# RELEASE: Check if commit is not a pull request, if repo is official, if branch is master; then run deployment script
18+
- "[[ $TRAVIS_PULL_REQUEST == false ]] && [[ $TRAVIS_REPO_SLUG == flow/commons ]] && [[ $TRAVIS_BRANCH == master ]] && $HOME/build/flow/travis/deploy.sh && $HOME/build/flow/travis/gh-pages.sh"
19+
# Generate Javadocs and report for Coveralls.io
20+
- "mvn javadoc:javadoc cobertura:cobertura coveralls:report -DserviceJobId=$TRAVIS_JOB_ID"
21+
22+
# RELEASE: Deploy main JAR to GitHub Releases
23+
deploy:
24+
provider: releases
25+
api-key: $GITHUB_TOKEN
26+
file: "target/flow-commons-`cat version.txt`.jar"
27+
skip_cleanup: true
28+
on:
29+
branch: master
1530

1631
# Notification services
1732
notifications:
@@ -27,5 +42,7 @@ env:
2742
# Make the log output cleaner
2843
- TERM=dumb
2944
# Super secure, encrypted variables! Ssssh!
30-
- secure: "KSYs2gR7UNxJd6YzcZpaJvumZuVIS3e1hcs0cFRhEi+lIBQ0AEScas9tUxAkUFRlmZmsKXv205HjDVTeWn//LXceVDrKBsXqurcH4SIji7tfEXKsv8QZ6ipO18Zt4SxG3Mg38XMRtf3SR9BzFJDLzWfdAqSOrozPtdkYQhn8E04="
31-
- secure: "SFZnSndb4c+1H/XCg9l4ovcJki8mEknXGwfjsL+lUMaaYG6qk0lBOS9GHXkEeQXlE8JD0IKSUSPzu38pKjXpoML28/4sLrQZSZZ+lBZOvRbI//Fcw8gx7KLXhQt9jpmYS3sUbcWAQstl9zGiKPjbQHeu3A+BgEpiUgtWqsixxsU="
45+
- secure: "LklzhudIFP6sEOg1Q+NWUQmi1An70tpf6wV5mYz74xnkKLj4SkQ8hd/zMmqlzim4Bic1djKk80QnBHFrCSisdlv/xkUbOjS8TBaCFX25KCyvCQkyf5/0ACbc1FJ/6T5DZ4PlhDYNdvtIIKEwscvXqAfW6wk2eup788nirpMZwuE="
46+
- secure: "HgjsSbugWYSce46xjjeV3l7UoGqqJ3ToCYcVjZXDKnJ6D/VCiGH8yAMbL7FQS+fbGX7NeCQpXUdvInCcMf4BUb3OX6ZQhlWMOcvvz/S2Sl+UWAkm0K0ArQE6JLx5JyGibUKyPX23Jips6h8XCEWz6g4bXIKC2zYApBkDR9+2Wbk="
47+
- secure: "F1z2+k894qHJMYvFtVN+CoMJvIM82NOsHSbZ6VRcNfQjwU0hfvYfuUKHG0WARsOI3aJ+UBSsfZY5Yer/gQEl0C0oIJRehG1bmX5wKzRhJrwTRz9V1XxQj5z8HBf3Rj0qhLqOqDdJLv86lUE+u1kHFggcBZUas90VYQjUJyvHJwM="
48+
- secure: "dzRb8lAQRcmD0CH3lMNHUs5ff82/aW34Rtf38MUQP8uNrR36kMGpGu8CFAcXqspn35kbYPRbems5F9wNjJkRgThK++Enobh9zy3N0/x5D85q34MZ6MGIBHrgpvA3JmTBNO1M75zmiJfYb/e6FoJT2ynoBdqb4GVehWEakJYI/qk="

0 commit comments

Comments
 (0)