-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
57 lines (57 loc) · 1.52 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
pipeline {
agent {
kubernetes {
defaultContainer 'ubuntu'
activeDeadlineSeconds 3600
}
}
stages {
stage('Init') {
steps {
checkout scm
script {
def m = (env.GIT_URL =~ /(\/|:)(([^\/]+)\/)?(([^\/]+?)(\.git)?)$/)
if (m) {
org = m.group(3)
repo = m.group(5)
}
}
}
}
stage('Setup build') {
when { not { buildingTag() } }
steps {
script {
target = "verify"
}
}
}
stage('Setup release') {
when { buildingTag(); not { changeRequest() } }
steps {
script {
target = "deploy -P release --settings settings.xml"
}
sh 'gpg --batch --import arpnetworking.key'
}
}
stage('Build') {
steps {
withCredentials([usernamePassword(credentialsId: 'jenkins-dockerhub', usernameVariable: 'DOCKER_USERNAME', passwordVariable: 'DOCKER_PASSWORD'),
usernamePassword(credentialsId: 'jenkins-ossrh', usernameVariable: 'OSSRH_USER', passwordVariable: 'OSSRH_PASS'),
string(credentialsId: 'jenkins-gpg', variable: 'GPG_PASS')]) {
withMaven {
sh "./jdk-wrapper.sh ./mvnw $target -U -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Ddocker.verbose=true"
}
}
}
}
}
post('Analysis') {
always {
recordIssues(
enabledForFailure: true, aggregatingResults: true,
tools: [java(), checkStyle(reportEncoding: 'UTF-8'), spotBugs()])
}
}
}