Skip to content
Snippets Groups Projects
Commit e5ba738f authored by Emmanuel Bruno's avatar Emmanuel Bruno
Browse files

adds travis.

parent 79f85d7c
Branches
No related tags found
No related merge requests found
#!/bin/sh
export USER_HOME_DIR=/root
docker run \
--rm \
-e SONAR_TOKEN=${SONAR_TOKEN} \
-e BINTRAY_API_KEY=${BINTRAY_API_KEY} \
-e UTLN_EMAIL=${UTLN_EMAIL} \
-e UTLN_PASSWORD=${UTLN_PASSWORD} \
-v $HOME/.sonar/cache:${USER_HOME_DIR}/.sonar/cache \
-v $HOME/.m2:${USER_HOME_DIR}/.m2 \
-v $(pwd):/usr/src/mysrc \
-w /usr/src/mysrc \
maven:3.5.0-jdk-8-alpine \
mvn \
-Duser.home=${USER_HOME_DIR} \
--settings ${USER_HOME_DIR}/.m2/settings.xml \
$*
<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
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>bintray-dptinfoutln-public</id>
<username>brunoe</username>
<password>${env.BINTRAY_API_KEY}</password>
</server>
<server>
<id>lsis-nexus</id>
<!-- ATTENTION UTILISER L'EMAIL UTLN -->
<username>${env.UTLN_EMAIL}</username>
<password>${env.UTLN_PASSWORD}</password>
</server>
</servers>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<sonar.host.url>https://sonar.lsis.univ-tln.fr</sonar.host.url>
<!-- generate a token in https://sonar.lsis.univ-tln.fr/account/security -->
<sonar.login>${env.SONAR_TOKEN}</sonar.login>
</properties>
</profile>
<profile>
<id>bintray</id>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-dptinfoutln-public</id>
<name>bintray</name>
<url>https://dl.bintray.com/dptinfoutln/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-dptinfoutln-public</id>
<name>bintray-plugins</name>
<url>https://dl.bintray.com/dptinfoutln/public</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<activeProfiles>
<activeProfile>bintray</activeProfile>
</activeProfiles>
</settings>
language: bash
sudo: required
cache:
directories:
- "$HOME/.m2/repository"
- "$HOME/.sonar/cache"
before_install:
#ignore gitflow commits except version tag
- |
if [[ "${TRAVIS_COMMIT_MESSAGE}" == "[gitflow]"* ]] && [[ "${TRAVIS_BRANCH}" != v[0-9]* ]]; then
travis_terminate 0
fi
before_script:
- cp .travis.settings.xml $HOME/.m2/settings.xml
script:
- |
if [[ "${TRAVIS_BRANCH}" == release-* ]]; then
QUALIFIER=-frozen-${TRAVIS_BUILD_NUMBER}
elif [[ "${TRAVIS_BRANCH}" == "development" ]]; then
QUALIFIER=-dev-${TRAVIS_BUILD_NUMBER}
elif [[ "${TRAVIS_BRANCH}" == v[0-9]* ]]; then
QUALIFIER=""
else
QUALIFIER=-${TRAVIS_BRANCH}-${TRAVIS_BUILD_NUMBER}
fi && ./.travis.scripts/mvn.sh build-helper:parse-version versions:set -DgenerateBackupPoms=false -DnewVersion='${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}'${QUALIFIER}
- "./.travis.scripts/mvn.sh -Dmaven.site.skip=true clean verify -B -e -V"
after_success:
- |
if [[ "${TRAVIS_BRANCH}" == v[0-9]* ]] || [[ "${TRAVIS_BRANCH}" == release-* ]] || [[ "${TRAVIS_BRANCH}" == "development" ]]; then
./.travis.scripts/mvn.sh sonar:sonar
fi
- |
if [[ "${TRAVIS_BRANCH}" == v[0-9]* ]]; then
./.travis.scripts/mvn.sh -P github-site site fi
deploy:
provider: script
script: "./.travis.scripts/mvn.sh -Dmaven.site.skip=true -P stage-devel-nexus deploy"
script: "./.travis.scripts/mvn.sh -Dmaven.site.skip=true -P stage-devel-bintray deploy"
skip_cleanup: true
on:
all_branches: true
branches:
except: # web site and version tag
- gh-pages
- master
# - /^v[0-9]/
......@@ -2,73 +2,80 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.univtln.bruno.d14</groupId>
<artifactId>exempleihm</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>exempleihm</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Le nom court du projet a utiliser pour github -->
<projectShortName>cours-java-librarymanager-simplegui</projectShortName>
<github.account>emmanuelbruno</github.account>
<!-- utln login for nexus (maven and docker ) repository on lsis -->
<lsisnexus.login>emmanuel.bruno@univ-tln.fr</lsisnexus.login>
<app.main.class>fr.univtln.bruno.d14.simpleihm.App</app.main.class>
</properties>
<repositories>
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-dptinfoutln-public</id>
<name>bintray</name>
<url>https://dl.bintray.com/dptinfoutln/public</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-dptinfoutln-public</id>
<name>bintray-plugins</name>
<url>https://dl.bintray.com/dptinfoutln/public</url>
</pluginRepository>
</pluginRepositories>
<parent>
<groupId>fr.univtln.bruno.pom</groupId>
<artifactId>common-pom</artifactId>
<version>0.7.30-dev-174</version>
</parent>
<groupId>fr.univtln.bruno.coursjava.librarymanager</groupId>
<artifactId>librarymanager-simplegui</artifactId>
<version>1.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>fr.univtln.bruno.exemple.bibliotheque</groupId>
<artifactId>observablebiblio</artifactId>
<version>1.0-SNAPSHOT</version>
<groupId>fr.univtln.bruno.coursjava.librarymanager</groupId>
<artifactId>librarymanager-observablelibrary</artifactId>
<version>1.0.0-dev-2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<!-- Only required to run tests in an IntelliJ IDEA that bundles an older version -->
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<id>create-executable-jar</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<descriptorRefs>
<descriptorRef>
jar-with-dependencies
</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>fr.univtln.bruno.d14.simpleihm.App</mainClass>
</manifest>
</archive>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment