forked from Wimmics/corese
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
68 lines (67 loc) · 1.8 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
pipeline {
agent any
environment {
DEPLOYMENT = readMavenPom().getProperties().getProperty("deployOnMavenCentral")
}
stages {
stage('Build') {
parallel {
stage('Build') {
steps {
sh 'mvn clean install -Pjenkins -Dmaven.test.skip=true'
}
}
stage('display value') {
steps {
sh "echo \"env.DEPLOY_TO_CENTRAL = ${env.DEPLOY_TO_CENTRAL}\""
}
}
}
}
stage('Test') {
steps {
sh 'mvn verify jacoco:report-aggregate -Dmaven.test.skip=false'
}
}
stage('deployment on maven.inria.fr') {
steps {
sh 'mvn deploy -Pmaven-inria-fr-release -Dmaven.test.skip=true'
}
}
stage('test on artefacts at maven.inria.fr') {
steps {
sh '''rm -fr ${HOME}/.m2/repository/fr/inria/corese
mvn -U test verify -Pmaven-inria-fr-release'''
}
}
stage('Report') {
parallel {
stage('Report') {
steps {
junit(testResults: '**/target/*-reports/*.xml', healthScaleFactor: 50)
}
}
stage('error') {
steps {
jacoco(classPattern: '**/classes', execPattern: '**/**.exec', inclusionPattern: '**/*.class', sourcePattern: '**/src/main/java')
}
}
}
}
stage('Deploy on maven ossrh (maven central)') {
steps {
script {
if (env.DEPLOY_TO_CENTRAL == 'true') {
echo 'deploying'
sh 'mvn deploy -Pmaven-central-release -Dmaven.test.skip=true'
} else {
echo 'not deploying since property deployOnMavenCentral is not set in the root pom.xml'
}
}
}
}
}
environment {
DEPLOY_TO_CENTRAL = readMavenPom().getProperties().getProperty("deployOnMavenCentral")
}
}