Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
PR for #68 (#78)
Browse files Browse the repository at this point in the history
build and deploy releases with github/travis/bintray
  • Loading branch information
Ingvord authored and gwen-soleil committed Aug 23, 2019
1 parent f538f5c commit 22239bc
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 16 deletions.
67 changes: 53 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,68 @@ services:
env:
- TANGO_HOST=localhost:10000

#skip mvn install
install: /bin/true

before_script:
- docker-compose up -d
#TODO wait-for-it
- sleep 30
- docker ps

#skip mvn install
install: /bin/true

script:
- mvn clean install -Ptravis
jdk:
- openjdk8
- openjdk7
after_success:
- bash <(curl -s https://codecov.io/bash)
- mvn sonar:sonar -Ptravis
- mvn com.gavinmogan:codacy-maven-plugin:coverage -Ptravis
addons:
sonarcloud:
organization: "tango-controls"
token:
secure: $SONAR_TOKEN
cache:
directories:
- '$HOME/.m2/repository'
- '$HOME/.m2/repository'


jobs:
include:
- stage: deploy
name: "Deploy to SonarCloud"
jdk: openjdk8
script:
- mvn clean install -Ptravis
- mvn sonar:sonar -Ptravis
addons:
sonarcloud:
organization: "tango-controls"
token:
secure: $SONAR_TOKEN
-
name: "Deploy to Codacy"
jdk: openjdk8
script:
- mvn clean install -Ptravis
- mvn com.gavinmogan:codacy-maven-plugin:coverage -Ptravis
-
name: "Deploy to Codcov.io"
jdk: openjdk8
script:
- mvn clean install -Ptravis
- bash <(curl -s https://codecov.io/bash)
-
name: "Deploy artifacts"
jdk: openjdk8
before_script: true #override before_script
script:
- cd parent
- mvn versions:set versions:update-child-modules -DnewVersion=${TRAVIS_BRANCH} -DprocessAllModule -DgenerateBackupPoms=false
- cd ..
- mvn install -Dmaven.test.skip=true
deploy:
- provider: script
script: bash .travis/maven_deploy.sh
skip_cleanup: true
on:
tags: true
- provider: releases
file: assembly/target/JTango-${TRAVIS_TAG}.jar
api_key: $GITHUB_TOKEN
skip_cleanup: true
draft: true
on:
tags: true
13 changes: 13 additions & 0 deletions .travis/maven_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

cp .travis/settings.xml $HOME/.m2/settings.xml

mvn deploy -Dmaven.test.skip=true

cd parent
mvn versions:set versions:update-child-modules -DprocessAllModules -DnextSnapshot -DgenerateBackupPoms=false
cd ..

.travis/push.sh
21 changes: 21 additions & 0 deletions .travis/push.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

setup_git() {
git config --global user.email "[email protected]"
git config --global user.name "Tango CI"
git remote rm origin
git remote add origin https://tango-ci:$GITHUB_TOKEN@github.com/tango-controls/JTango.git
}

commit_website_files() {
git add . pom.xml
git commit --message "[Tango CI] Next development iteration"
}

upload_files() {
git push --quiet origin HEAD:jtango-9-lts
}

setup_git
commit_website_files
upload_files
10 changes: 10 additions & 0 deletions .travis/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers>
<server>
<id>bintray-tango-controls</id>
<username>tango-ci</username>
<password>${env.BINTRAY_TOKEN}</password>
</server>
</servers>
</settings>
4 changes: 2 additions & 2 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -291,15 +291,15 @@
<properties>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>tango-controls</sonar.organization>
<sonar.branch>jtango-9-lts</sonar.branch>
<!--sonar.branch>jtango-9-lts</sonar.branch-->
<sonar.login>${env.SONAR_TOKEN}</sonar.login>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.2</version>
<version>3.6.0.1398</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
Expand Down

0 comments on commit 22239bc

Please sign in to comment.