add Jenkinsfile script for continuous integration

This commit is contained in:
Matthieu Kermagoret 2019-02-11 09:32:22 +01:00
parent a15a25e996
commit 653e271032
2 changed files with 38 additions and 0 deletions

35
connectors/vmware/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,35 @@
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') {
withSonarQubeEnv('SonarQube') {
sh './centreon-build/jobs/vmware/vmware-analysis.sh'
}
}
}
}
try {
stage('Package') {
parallel 'centos7': {
node {
sh 'setup_centreon_build.sh'
sh './centreon-build/jobs/vmware/vmware-package.sh'
}
}
if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
error('Package stage failure.');
}
}
} 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}"
}
}

View File

@ -0,0 +1,3 @@
sonar.projectKey=centreon-vmware
sonar.projectName=Centreon VMWare
sonar.sources=.