centreon-plugins/connectors/vmware/Jenkinsfile

70 lines
2.5 KiB
Plaintext
Raw Normal View History

stage('Source') {
node {
sh 'setup_centreon_build.sh'
dir('centreon-vmware') {
checkout scm
}
sh './centreon-build/jobs/vmware/vmware-source.sh'
source = readProperties file: 'source.properties'
env.VERSION = "${source.VERSION}"
env.RELEASE = "${source.RELEASE}"
if (env.BRANCH_NAME == 'master') {
2021-10-27 14:07:52 +02:00
withSonarQubeEnv('SonarQubeDev') {
sh './centreon-build/jobs/vmware/vmware-analysis.sh'
}
}
}
}
try {
stage('Package') {
parallel 'centos7': {
node {
sh 'setup_centreon_build.sh'
2019-02-11 09:56:49 +01:00
sh './centreon-build/jobs/vmware/vmware-package.sh centos7'
2021-10-27 14:07:52 +02:00
archiveArtifacts artifacts: 'rpms-centos7.tar.gz'
stash name: "rpms-centos7", includes: 'output/noarch/*.rpm'
sh 'rm -rf output'
}
2022-04-14 10:14:30 +02:00
},
2022-04-14 10:19:17 +02:00
'alma8': {
node {
sh 'setup_centreon_build.sh'
sh './centreon-build/jobs/vmware/vmware-package.sh alma8'
archiveArtifacts artifacts: 'rpms-alma8.tar.gz'
stash name: "rpms-alma8", includes: 'output/noarch/*.rpm'
sh 'rm -rf output'
}
},
2022-04-12 14:33:51 +02:00
'Debian bullseye packaging and signing': {
node {
dir('centreon-vmware') {
checkout scm
}
sh 'docker run -i --entrypoint "/src/centreon-vmware/ci/scripts/vmware-deb-package.sh" -w "/src" -v "$PWD:/src" -e "DISTRIB=Debian11" -e "VERSION=$VERSION" -e "RELEASE=$RELEASE" registry.centreon.com/centreon-debian11-dependencies:22.04'
2022-04-14 10:11:03 +02:00
stash name: 'Debian11', includes: '*.deb'
archiveArtifacts artifacts: "*"
2022-04-12 14:33:51 +02:00
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Package stage failure.');
}
}
2021-10-27 14:07:52 +02:00
stage('Delivery') {
2021-10-27 14:26:46 +02:00
node {
sh 'setup_centreon_build.sh'
2022-04-14 10:30:14 +02:00
unstash "Debian11"
2021-10-27 14:26:46 +02:00
unstash "rpms-centos7"
2022-04-14 10:19:17 +02:00
unstash "rpms-alma8"
2021-10-27 14:26:46 +02:00
sh './centreon-build/jobs/vmware/vmware-delivery.sh'
2022-04-14 10:43:38 +02:00
withCredentials([usernamePassword(credentialsId: 'nexus-credentials', passwordVariable: 'NEXUS_PASSWORD', usernameVariable: 'NEXUS_USERNAME')]) {
sh './ci/scripts/vmware-deliver-deb-package.sh $NEXUS_USERNAME $NEXUS_PASSWORD $VERSION'
}
2021-10-27 14:26:46 +02:00
}
2021-10-27 14:07:52 +02:00
}
} catch(e) {
if (env.BRANCH_NAME == 'master') {
slackSend channel: "#monitoring-metrology", color: "#F30031", message: "*FAILURE*: `CENTREON VMWARE` <${env.BUILD_URL}|build #${env.BUILD_NUMBER}> on branch ${env.BRANCH_NAME}\n*COMMIT*: <https://github.com/centreon/centreon-vmware/commit/${source.COMMIT}|here> by ${source.COMMITTER}\n*INFO*: ${e}"
}
}