Commit f3fb5e44 authored by Zakaria Guennoune's avatar Zakaria Guennoune Committed by Zakaria Guennoune
Browse files

enh(ci) : New packaging workflow (#58)

* new packaging workflow

* adding label to nodes

* adding rpm as jenkins artifacts
Conflicts:
	Jenkinsfile
parent f3b43f83
import groovy.json.JsonSlurper
/*
** Variables.
*/
properties([buildDiscarder(logRotator(numToKeepStr: '10'))])
def serie = '21.10'
def maintenanceBranch = "${serie}.x"
def qaBranch = "dev-${serie}"
if (env.BRANCH_NAME.startsWith('release-')) {
env.BUILD = 'RELEASE'
} else if ((env.BRANCH_NAME == 'master') || (env.BRANCH_NAME == maintenanceBranch)) {
env.BUILD = 'REFERENCE'
} else if ((env.BRANCH_NAME == 'develop') || (env.BRANCH_NAME == qaBranch)) {
env.BUILD = 'QA'
} else {
env.BUILD = 'CI'
}
......@@ -17,7 +20,7 @@ if (env.BRANCH_NAME.startsWith('release-')) {
** Pipeline code.
*/
stage('Source') {
node {
node("C++") {
sh 'setup_centreon_build.sh'
dir('centreon-clib') {
checkout scm
......@@ -43,8 +46,7 @@ stage('Source') {
try {
// sonarQube step to get qualityGate result
stage('Quality gate') {
node {
sleep 120
node("C++") {
def qualityGate = waitForQualityGate()
if (qualityGate.status != 'OK') {
currentBuild.result = 'FAIL'
......@@ -56,17 +58,18 @@ try {
}
stage('Package') {
parallel 'centos7': {
node {
parallel 'packaging centos7': {
node("C++") {
sh 'setup_centreon_build.sh'
sh "./centreon-build/jobs/clib/${serie}/mon-clib-package.sh centos7"
archiveArtifacts artifacts: "output/x86_64/*.rpm"
stash name: 'el7-rpms', includes: "output/x86_64/*.rpm"
archiveArtifacts artifacts: "output/x86_64/*.rpm"
sh 'rm -rf output'
}
},
'centos8': {
node {
'packaging centos8': {
node("C++") {
sh 'setup_centreon_build.sh'
sh "./centreon-build/jobs/clib/${serie}/mon-clib-package.sh centos8"
stash name: 'el8-rpms', includes: "output/x86_64/*.rpm"
......@@ -74,36 +77,31 @@ try {
sh 'rm -rf output'
}
},
'debian10': {
node {
'packaging debian10': {
node("C++") {
sh 'setup_centreon_build.sh'
sh "./centreon-build/jobs/clib/${serie}/mon-clib-package.sh debian10"
}
},
'debian10-armhf': {
node {
'packaging debian10-armhf': {
node("C++") {
sh 'setup_centreon_build.sh'
sh "./centreon-build/jobs/clib/${serie}/mon-clib-package.sh debian10-armhf"
}
/*
},
'opensuse-leap': {
node {
sh 'setup_centreon_build.sh'
sh "./centreon-build/jobs/clib/${serie}/mon-clib-package.sh opensuse-leap"
}
*/
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Package stage failure.');
error('Packaging stage failure');
}
}
if ((env.BUILD == 'RELEASE') || (env.BUILD == 'REFERENCE')) {
if ((env.BUILD == 'RELEASE') || (env.BUILD == 'QA')) {
stage('Delivery') {
node("C++") {
<<<<<<< HEAD
unstash 'el7-rpms'
unstash 'el8-rpms'
=======
>>>>>>> 1703b5e... enh(ci) : New packaging workflow (#58)
sh 'setup_centreon_build.sh'
sh "./centreon-build/jobs/clib/${serie}/mon-clib-delivery.sh"
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment