-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathJenkinsfile_nightly
More file actions
114 lines (109 loc) · 4.24 KB
/
Jenkinsfile_nightly
File metadata and controls
114 lines (109 loc) · 4.24 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
* (C) Copyright IBM Deutschland GmbH 2021, 2025
* (C) Copyright IBM Corp. 2021, 2025
*
* non-exclusively licensed to gematik GmbH
*/
pipeline {
agent {
node {
label 'dockerstage'
}
}
triggers {
cron('H 4 * * *')
}
options {
disableConcurrentBuilds()
skipDefaultCheckout()
copyArtifactPermission(
'/eRp/Integration/erp_processing_context_dev, ' +
'/eRp/Integration/erp_processing_context_dev2, ' +
'/eRp/Integration/erp_processing_context_box, ' +
'/eRp/Integration/erp_processing_context_box2, ' +
'/eRp/Integration/erp_processing_context_lu, ' +
'/eRp/Integration/erp_processing_context_lu2'
)
}
environment {
GIT_SOURCE_CREDS = credentials('jenkins-github-erp')
}
stages {
stage('Checkout') {
options {
throttle(['unit-test-category'])
}
steps {
cleanWs()
commonCheckout()
}
}
stage('Static Analysis') {
options {
throttle(['gcc-build-category'])
}
agent {
docker {
label 'dockerstage'
image 'de.icr.io/erp_dev/erp-pc-ubuntu-build:2.3.1'
registryUrl 'https://de.icr.io/v2'
registryCredentialsId 'icr_image_puller_erp_dev_api_key'
reuseNode true
args '-u root:sudo ' + " -v ${env.WORKSPACE}:/media/erp"
}
}
environment {
BRANCH_NAME = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
}
steps {
script {
loadNexusConfiguration {
loadGithubSSHConfiguration {
env.BRANCH_NAME = "${BRANCH_NAME}"
def erp_build_version = sh(returnStdout: true, script: "git describe").trim()
def erp_release_version = "1.21.0"
sh "cd /media/erp && scripts/ci-build.sh " +
"--build_type=RelWithDebInfo " +
"--build_version='${erp_build_version}' " +
"--release_version='${erp_release_version}' " +
"--skip-build"
sh "cd /media/erp && scripts/ci-static-analysis.sh " +
"--build-path=build/RelWithDebInfo " +
"--source-path=. " +
"--clang-tidy-bin=clang-tidy-19 " +
"--output=clang-tidy.txt " +
"--clang-tidy-config=.clang-tidy.nightly "
archiveArtifacts artifacts: 'clang-tidy.txt', allowEmptyArchive:true
staticAnalysis("SonarQubeeRp")
timeout(time: 5, unit: 'MINUTES') {
waitForQualityGate abortPipeline: true
}
// Fix build folder file permissions
sh "chmod o+w build/"
}
}
}
}
}
}
post {
cleanup {
cleanWs()
}
failure {
script {
def url = env.BUILD_URL.replaceAll("%", "%25")
def branchName = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
slackSendClient(message: "Nightly build ${env.BUILD_DISPLAY_NAME} failed for branch `${branchName}`:rotating_light: \nFor more details visit <${url}|the build page>",
channel: '#erp-cpp')
}
}
fixed {
script {
def branchName = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim()
slackSendClient(message: "Nightly build is now successful again on branch `${branchName}`:green_heart:",
channel: '#erp-cpp')
}
}
}
}