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

Commit

Permalink
checkout centreon build the new way (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
zguennoune02 authored Oct 26, 2021
1 parent fc45145 commit c7ae55f
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,22 @@ if (env.BRANCH_NAME.startsWith('release-')) {
env.BUILD = 'CI'
}

def checkoutCentreonBuild() {
dir('centreon-build') {
checkout resolveScm(source: [$class: 'GitSCMSource',
remote: 'https://github.com/centreon/centreon-build.git',
credentialsId: 'technique-ci',
traits: [[$class: 'jenkins.plugins.git.traits.BranchDiscoveryTrait']]],
targets: [BRANCH_NAME, 'master'])
}
}

/*
** Pipeline code.
*/
stage('Deliver sources') {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
dir('centreon-broker') {
checkout scm
}
Expand All @@ -36,7 +46,7 @@ try {
stage('Build // Unit tests // Packaging') {
parallel 'build centos7': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/broker/${serie}/mon-broker-unittest.sh centos7"
step([
$class: 'XUnitBuilder',
Expand All @@ -54,15 +64,15 @@ try {
},
'packaging centos7': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/broker/${serie}/mon-broker-package.sh centos7"
stash name: 'el7-rpms', includes: "output/x86_64/*.rpm"
archiveArtifacts artifacts: "output/x86_64/*.rpm"
}
},
'build centos8': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/broker/${serie}/mon-broker-unittest.sh centos8"
step([
$class: 'XUnitBuilder',
Expand All @@ -76,7 +86,7 @@ try {
},
'packaging centos8': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/broker/${serie}/mon-broker-package.sh centos8"
stash name: 'el8-rpms', includes: "output/x86_64/*.rpm"
archiveArtifacts artifacts: "output/x86_64/*.rpm"
Expand Down Expand Up @@ -125,7 +135,7 @@ try {
node("C++") {
unstash 'el7-rpms'
unstash 'el8-rpms'
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/broker/${serie}/mon-broker-delivery.sh"
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
Expand Down

0 comments on commit c7ae55f

Please sign in to comment.