-
Notifications
You must be signed in to change notification settings - Fork 111
/
Jenkinsfile
52 lines (51 loc) · 2.02 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
pipeline {
agent { label 'linux' }
stages {
stage('Checkout') {
steps {
script {
infra.checkoutSCM()
}
}
}
stage('Build') {
steps {
script {
m2repo = "${pwd tmp: true}/m2repo"
String jdk = "21"
List<String> mavenOptions = [
'--update-snapshots',
"-Dmaven.repo.local=$m2repo",
'-Dmaven.test.failure.ignore',
"-Dset.changelist",
"-Djava.security.egd=file:/dev/./urandom",
"clean install"
]
infra.runMaven(mavenOptions, jdk)
}
}
post {
always {
/*
archiveArtifacts(allowEmptyArchive: true,
artifacts: "** /target/trilead*.jar",
onlyIfSuccessful: false)
*/
junit(allowEmptyResults: true,
keepLongStdio: true,
testResults: "**/target/surefire-reports/**/*.xml")
script {
def m2repo = "${pwd tmp: true}/m2repo"
// No easy way to load both of these in one command: https://stackoverflow.com/q/23521889/12916
String version = sh script: 'mvn -Dset.changelist -Dexpression=project.version -q -DforceStdout help:evaluate', returnStdout: true
echo "Collecting $version from $m2repo for possible Incrementals publishing"
dir(m2repo) {
archiveArtifacts "org/jenkins-ci/trilead-ssh2/$version/*$version*"
}
infra.maybePublishIncrementals()
}
}
}
}
}
}