Skip to content
Permalink
Browse files

[ci] Travis updates

  • Loading branch information
hazendaz committed Jul 3, 2017
1 parent b9e9e68 commit 108ed0f1dd240ad690aa3c37bceeeb6c83e7d12c
Showing with 112 additions and 5 deletions.
  1. +7 −5 .travis.yml
  2. +54 −0 travis/after_success.sh
  3. +18 −0 travis/install.sh
  4. +33 −0 travis/settings.xml
@@ -1,11 +1,13 @@
language: java

install: ./mvnw install -DskipTests=true -Dmaven.javadoc.skip=true -Dfindbugs.skip=true -B -V

jdk:
- openjdk11
- openjdk8

cache:
directories:
- $HOME/.m2
install:
- chmod -R 777 ./travis/install.sh
- ./travis/install.sh

after_success:
- chmod -R 777 ./travis/after_success.sh
- ./travis/after_success.sh
@@ -0,0 +1,54 @@
#!/bin/bash
#
# Copyright 2010-2017 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Get Commit Message
commit_message=$(git log --format=%B -n 1)
echo "Current commit detected: ${commit_message}"

# We build for several JDKs on Travis.
# Some actions, like analyzing the code (Coveralls) and uploading
# artifacts on a Maven repository, should only be made for one version.

# If the version is 1.8, then perform the following actions.
# 1. Upload artifacts to Sonatype.
# 2. Use -q option to only display Maven errors and warnings.
# 3. Use --settings to force the usage of our "settings.xml" file.
# 4. Deploy site

if [ $TRAVIS_REPO_SLUG == "mebigfatguy/fb-contrib" ] && [ $TRAVIS_PULL_REQUEST == "false" ] && [ $TRAVIS_BRANCH == "master" ] && [[ "$commit_message" != *"[maven-release-plugin]"* ]]; then

if [ $TRAVIS_JDK_VERSION == "openjdk8" ]; then

# Deploy to sonatype
# ./mvnw deploy -q --settings ./travis/settings.xml
# echo -e "Successfully deployed SNAPSHOT artifacts to Sonatype under Travis job ${TRAVIS_JOB_NUMBER}"

# ./mvnw clean test jacoco:report coveralls:report -q --settings ./travis/settings.xml
# echo -e "Successfully ran coveralls under Travis job ${TRAVIS_JOB_NUMBER}"

# Deploy to site
# Cannot currently run site this way
# ./mvnw site site:deploy -q --settings ./travis/settings.xml
# echo -e "Successfully deploy site under Travis job ${TRAVIS_JOB_NUMBER}"

# Deploy to sonar
# ./mvnw clean org.jacoco:jacoco-maven-plugin:prepare-agent package sonar:sonar -Dsonar.host.url=https://sonarqube.com -Dsonar.login= -q --settings ./travis/settings.xml
# echo -e "Successfully ran Sonar integration under Travis job ${TRAVIS_JOB_NUMBER}"
fi
else
echo "Travis build skipped"
fi
@@ -0,0 +1,18 @@
#!/bin/bash
#
# Copyright 2009-2016 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

mvn install -B -V
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2010-2016 the original author or authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>${env.CI_DEPLOY_USERNAME}</username>
<password>${env.CI_DEPLOY_PASSWORD}</password>
</server>
<server>
<id>gh-pages</id>
<username>git</username>
<password>${env.CI_SITE_PASSWORD}</password>
</server>
</servers>
</settings>

0 comments on commit 108ed0f

Please sign in to comment.
You can’t perform that action at this time.