Merge pull request #12 from kemitix/jenkins

Add Jenkinsfile
This commit is contained in:
Paul Campbell 2018-02-24 22:12:49 +00:00 committed by GitHub
commit ee34e86b3b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 26 deletions

View file

@ -5,7 +5,7 @@ cache:
directories: directories:
- "$HOME/.m2" - "$HOME/.m2"
install: true install: true
script: "./mvnw clean install" script: "./mvnw -B -U clean install"
after_success: after_success:
- sh .travis-support/coveralls.sh - sh .travis-support/coveralls.sh
- bash <(curl -s https://codecov.io/bash) - bash <(curl -s https://codecov.io/bash)

View file

@ -1,6 +1,12 @@
CHANGELOG CHANGELOG
========= =========
0.4.0
-----
* Building with Jenkins
* Upgrade `kemitix-parent` to 5.0.3
0.3.0 0.3.0
----- -----

24
Jenkinsfile vendored
View file

@ -1,20 +1,36 @@
pipeline { pipeline {
agent any agent any
stages { stages {
stage('Build') { stage('Prepare') {
steps { steps {
checkout([ checkout([
$class: 'GitSCM', $class: 'GitSCM',
branches: [[name: '**']], branches: [[name: '**']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'CleanBeforeCheckout']], extensions: [[$class: 'CleanBeforeCheckout']],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'github-kemitix', url: 'git@github.com:kemitix/conditional.git']] userRemoteConfigs: [[credentialsId: 'github-kemitix', url: 'git@github.com:kemitix/conditional.git']]
]) ])
sh './mvnw clean install' }
}
stage('Build') {
steps {
sh './mvnw -B -U clean install'
}
}
stage('Reporting') {
steps {
junit '**/target/surefire-reports/*.xml' junit '**/target/surefire-reports/*.xml'
archiveArtifacts '**/target/*.jar' archiveArtifacts '**/target/*.jar'
} }
} }
stage('Deploy') {
when {
expression {
env.GIT_BRANCH == 'master'
}
}
steps {
sh './mvnw -B -Dskip-Tests=true -P release deploy'
}
}
} }
} }

43
pom.xml
View file

@ -4,8 +4,9 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 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> <modelVersion>4.0.0</modelVersion>
<properties> <properties>
<kemitix-checkstyle-ruleset.version>3.2.0</kemitix-checkstyle-ruleset.version> <java.version>1.8</java.version>
<kemitix-checkstyle-ruleset.level>5-complexity</kemitix-checkstyle-ruleset.level> <kemitix-checkstyle.version>4.0.1</kemitix-checkstyle.version>
<kemitix.checkstyle.ruleset.level>5-complexity</kemitix.checkstyle.ruleset.level>
<jacoco-class-line-covered-ratio>1</jacoco-class-line-covered-ratio> <jacoco-class-line-covered-ratio>1</jacoco-class-line-covered-ratio>
<jacoco-class-instruction-covered-ratio>1</jacoco-class-instruction-covered-ratio> <jacoco-class-instruction-covered-ratio>1</jacoco-class-instruction-covered-ratio>
<jacoco-class-missed-count-maximum>0</jacoco-class-missed-count-maximum> <jacoco-class-missed-count-maximum>0</jacoco-class-missed-count-maximum>
@ -14,18 +15,27 @@
<junit.version>4.12</junit.version> <junit.version>4.12</junit.version>
<assertj.version>3.8.0</assertj.version> <assertj.version>3.8.0</assertj.version>
<coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version> <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
<tiles-maven-plugin.version>2.10</tiles-maven-plugin.version>
<kemitix-tiles.version>0.5.1</kemitix-tiles.version>
<lombok.version>1.16.20</lombok.version>
</properties> </properties>
<parent> <parent>
<groupId>net.kemitix</groupId> <groupId>net.kemitix</groupId>
<artifactId>kemitix-parent</artifactId> <artifactId>kemitix-parent</artifactId>
<version>3.2.0</version> <version>5.0.3</version>
<relativePath/> <relativePath/>
</parent> </parent>
<artifactId>conditional</artifactId> <artifactId>conditional</artifactId>
<version>0.4.0-SNAPSHOT</version> <version>0.4.0-SNAPSHOT</version>
<dependencies> <dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
<optional>true</optional>
</dependency>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
@ -43,25 +53,16 @@
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>net.kemitix</groupId> <groupId>io.repaint.maven</groupId>
<artifactId>kemitix-checkstyle-ruleset-maven-plugin</artifactId> <artifactId>tiles-maven-plugin</artifactId>
<version>${kemitix-checkstyle-ruleset.version}</version> <version>${tiles-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration> <configuration>
<level>${kemitix-checkstyle-ruleset.level}</level> <tiles>
<tile>net.kemitix.tiles:all:${kemitix-tiles.version}</tile>
<tile>net.kemitix.checkstyle:tile:${kemitix-checkstyle.version}</tile>
</tiles>
</configuration> </configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>${coveralls-maven-plugin.version}</version>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>