-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJenkinsfile
68 lines (67 loc) · 1.62 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
def withMavenWorkspace(Closure body) {
withMaven(jdk: 'OpenJDK 17 Latest', maven: 'Apache Maven 3.9',
mavenLocalRepo: env.WORKSPACE_TMP + '/.m2repository',
options: [
artifactsPublisher(disabled: true),
junitPublisher(disabled: true)
]) {
withCredentials([string(credentialsId: 'ge.hibernate.org-access-key',
variable: 'GRADLE_ENTERPRISE_ACCESS_KEY')]) {
withGradle { // withDevelocity, actually: https://plugins.jenkins.io/gradle/#plugin-content-capturing-build-scans-from-jenkins-pipeline
body()
}
}
}
}
pipeline {
agent none
options {
buildDiscarder logRotator(daysToKeepStr: '10', numToKeepStr: '3')
disableConcurrentBuilds(abortPrevious: true)
}
stages {
stage('Default build') {
agent {
label 'Worker&&Containers'
}
steps {
timeout(time: 30, unit: 'MINUTES') {
withMavenWorkspace {
sh "mvn clean install -U -Pdist -DskipTests"
dir(env.WORKSPACE_TMP + '/.m2repository') {
stash name: 'original-build-result', includes: "org/hibernate/infra/"
}
}
}
}
}
stage('Non-default envs') {
matrix {
axes {
axis {
name 'ENV_NAME'
values 'elasticsearch-7', 'postgresql', 'opensearch-2.12'
}
}
stages {
stage('Build') {
agent {
label 'Worker&&Containers'
}
steps {
dir(env.WORKSPACE_TMP + '/.m2repository') {
unstash name: 'original-build-result'
}
withMavenWorkspace {
sh """ \
mvn clean install -U -Pdependency-update -Pdist -Pci-build -Dscan.tag.${env.ENV_NAME} \
--fail-at-end \
"""
}
}
}
}
}
}
}
}