Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit c7ae55f

Browse files
authored
checkout centreon build the new way (#688)
1 parent fc45145 commit c7ae55f

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

Jenkinsfile

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,22 @@ if (env.BRANCH_NAME.startsWith('release-')) {
1616
env.BUILD = 'CI'
1717
}
1818

19+
def checkoutCentreonBuild() {
20+
dir('centreon-build') {
21+
checkout resolveScm(source: [$class: 'GitSCMSource',
22+
remote: 'https://github.com/centreon/centreon-build.git',
23+
credentialsId: 'technique-ci',
24+
traits: [[$class: 'jenkins.plugins.git.traits.BranchDiscoveryTrait']]],
25+
targets: [BRANCH_NAME, 'master'])
26+
}
27+
}
28+
1929
/*
2030
** Pipeline code.
2131
*/
2232
stage('Deliver sources') {
2333
node("C++") {
24-
sh 'setup_centreon_build.sh'
34+
checkoutCentreonBuild()
2535
dir('centreon-broker') {
2636
checkout scm
2737
}
@@ -36,7 +46,7 @@ try {
3646
stage('Build // Unit tests // Packaging') {
3747
parallel 'build centos7': {
3848
node("C++") {
39-
sh 'setup_centreon_build.sh'
49+
checkoutCentreonBuild()
4050
sh "./centreon-build/jobs/broker/${serie}/mon-broker-unittest.sh centos7"
4151
step([
4252
$class: 'XUnitBuilder',
@@ -54,15 +64,15 @@ try {
5464
},
5565
'packaging centos7': {
5666
node("C++") {
57-
sh 'setup_centreon_build.sh'
67+
checkoutCentreonBuild()
5868
sh "./centreon-build/jobs/broker/${serie}/mon-broker-package.sh centos7"
5969
stash name: 'el7-rpms', includes: "output/x86_64/*.rpm"
6070
archiveArtifacts artifacts: "output/x86_64/*.rpm"
6171
}
6272
},
6373
'build centos8': {
6474
node("C++") {
65-
sh 'setup_centreon_build.sh'
75+
checkoutCentreonBuild()
6676
sh "./centreon-build/jobs/broker/${serie}/mon-broker-unittest.sh centos8"
6777
step([
6878
$class: 'XUnitBuilder',
@@ -76,7 +86,7 @@ try {
7686
},
7787
'packaging centos8': {
7888
node("C++") {
79-
sh 'setup_centreon_build.sh'
89+
checkoutCentreonBuild()
8090
sh "./centreon-build/jobs/broker/${serie}/mon-broker-package.sh centos8"
8191
stash name: 'el8-rpms', includes: "output/x86_64/*.rpm"
8292
archiveArtifacts artifacts: "output/x86_64/*.rpm"
@@ -125,7 +135,7 @@ try {
125135
node("C++") {
126136
unstash 'el7-rpms'
127137
unstash 'el8-rpms'
128-
sh 'setup_centreon_build.sh'
138+
checkoutCentreonBuild()
129139
sh "./centreon-build/jobs/broker/${serie}/mon-broker-delivery.sh"
130140
}
131141
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {

0 commit comments

Comments
 (0)