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

Commit

Permalink
fix(ci):adapt Jenkinsfile from dev-21.04.x
Browse files Browse the repository at this point in the history
  • Loading branch information
chgautier committed Jun 3, 2022
1 parent 805b8cf commit a05cedf
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import groovy.json.JsonSlurper
/*
** Variables.
*/
properties([buildDiscarder(logRotator(numToKeepStr: '50'))])
def serie = '21.04'
def maintenanceBranch = "${serie}.x"
def qaBranch = "dev-${serie}.x"
Expand All @@ -16,12 +14,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('Source') {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
dir('centreon-engine') {
checkout scm
}
Expand All @@ -44,7 +52,7 @@ try {
stage('Build // Unit Tests // RPMs Packaging') {
parallel 'build centos7': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/engine/${serie}/mon-engine-unittest.sh centos7"
step([
$class: 'XUnitBuilder',
Expand All @@ -61,15 +69,15 @@ try {
},
'packaging centos7': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/engine/${serie}/mon-engine-package.sh centos7"
stash name: 'el7-rpms', includes: "output/x86_64/*.rpm"
archiveArtifacts artifacts: "output/x86_64/*.rpm"
}
},
'build alma8': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/engine/${serie}/mon-engine-unittest.sh alma8"
step([
$class: 'XUnitBuilder',
Expand All @@ -83,15 +91,15 @@ try {
},
'packaging alma8': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/engine/${serie}/mon-engine-package.sh alma8"
stash name: 'el8-rpms', includes: "output/x86_64/*.rpm"
stash name: 'alma8-rpms', includes: "output/x86_64/*.rpm"
archiveArtifacts artifacts: "output/x86_64/*.rpm"
}
},
'build debian10': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/engine/${serie}/mon-engine-unittest.sh debian10"
step([
$class: 'XUnitBuilder',
Expand All @@ -105,7 +113,7 @@ try {
},
'packaging debian10': {
node("C++") {
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/engine/${serie}/mon-engine-package.sh debian10"
}
}
Expand Down Expand Up @@ -134,7 +142,7 @@ try {
node {
unstash 'el7-rpms'
unstash 'alma8-rpms'
sh 'setup_centreon_build.sh'
checkoutCentreonBuild()
sh "./centreon-build/jobs/engine/${serie}/mon-engine-delivery.sh"
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
Expand Down

0 comments on commit a05cedf

Please sign in to comment.