enh(ci): Debian pkg centreon plugins delivery (#3730)

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* Update Jenkinsfile

* delivery debian packages

* Update Jenkinsfile

* Update Jenkinsfile
This commit is contained in:
Zakaria Guennoune 2022-06-14 11:08:31 +02:00 committed by GitHub
parent 5118894e7b
commit fcc1db9586
1 changed files with 28 additions and 28 deletions

View File

@ -2,12 +2,15 @@
env.REF_BRANCH = 'master'
if ((env.BRANCH_NAME == env.REF_BRANCH)) {
env.BUILD = 'REFERENCE'
env.REPO = 'testing'
} else {
env.BUILD = 'CI'
env.REPO = 'unstable'
}
stage('Source') {
node {
cleanWs()
sh 'setup_centreon_build.sh'
dir('centreon-plugins') {
checkout scm
@ -29,8 +32,8 @@ stage('Source') {
}
}
stage('RPM Packaging') {
parallel 'package rpms': {
stage('RPM/DEB Packaging') {
parallel 'RPM': {
node {
sh 'setup_centreon_build.sh'
sh './centreon-build/jobs/plugins/plugins-package.sh'
@ -38,9 +41,8 @@ stage('RPM Packaging') {
archiveArtifacts artifacts: 'rpms-alma8.tar.gz'
stash name: "rpms-centos7", includes: 'output-centos7/noarch/*.rpm'
stash name: "rpms-alma8", includes: 'output-alma8/noarch/*.rpm'
sh 'rm -rf output'
}
},
}
'package debian bullseye': {
node {
sh 'setup_centreon_build.sh'
@ -54,32 +56,30 @@ stage('RPM Packaging') {
}
}
if ((env.BUILD == 'REFERENCE' )) {
stage('RPM Delivery') {
parallel 'deliver rpms': {
node {
sh 'setup_centreon_build.sh'
unstash 'rpms-centos7'
unstash 'rpms-alma8'
sh './centreon-build/jobs/plugins/plugins-delivery.sh'
}
},
'deliver debian bullseye': {
node {
withCredentials([usernamePassword(credentialsId: 'nexus-credentials', passwordVariable: 'NEXUS_PASSWORD', usernameVariable: 'NEXUS_USERNAME')]) {
checkout scm
unstash "Debian11"
sh '''for i in $(echo *.deb)
do
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD -H "Content-Type: multipart/form-data" --data-binary "@./$i" https://apt.centreon.com/repository/22.04-unstable/
done
'''
}
stage('RPM Delivery') {
parallel 'rpm delivery': {
node {
sh 'setup_centreon_build.sh'
unstash 'rpms-centos7'
unstash 'rpms-alma8'
sh './centreon-build/jobs/plugins/plugins-delivery.sh'
}
},
'deliver debian bullseye': {
node {
withCredentials([usernamePassword(credentialsId: 'nexus-credentials', passwordVariable: 'NEXUS_PASSWORD', usernameVariable: 'NEXUS_USERNAME')]) {
checkout scm
unstash "Debian11"
sh '''for i in $(echo *.deb)
do
curl -u $NEXUS_USERNAME:$NEXUS_PASSWORD -H "Content-Type: multipart/form-data" --data-binary "@./$i" https://apt.centreon.com/repository/22.04-$REPO/
done
'''
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Package stage failure.');
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Package stage failure.');
}
}