Private GIT

Skip to content
Snippets Groups Projects
Select Git revision
  • de6a593049537ba0254ba933cc8a6265a96838bd
  • master default protected
  • MON-2693-new-menu
  • php7-migration
  • poc-redis
  • security-fix-virtual-metrics-sql
  • security-fix-reporting
  • security-fix-menu-username
  • security-fix-export-graph
  • security-fix-metrics-injection
  • security-fix-virtual-metrics
  • security-fix-curves-templates
  • security-fix-command-form
  • security-fix-administration-logs
  • clapi_filter
  • MON2733-C2_Security_fix
  • new-header-2.8.x
  • MON-2725-ldap-passwords
  • 2.8.x
  • 6073-fix-view-contact-notifications
  • MON2703-new-api-menu
  • 2.8.23
  • 2.8.22
  • 2.8.21
  • 2.8.20
  • 2.8.19
  • 2.8.18
  • 2.8.17
  • 2.8.216
  • 2.8.16
  • 2.7.13
  • 2.8.15
  • help
  • 2.8.14
  • 2.8.13
  • 2.8.12
  • 2.7.12
  • 2.8.11
  • 2.8.10
  • 2.8.10-release
  • 2.8.9
41 results

Jenkinsfile

Blame
  • user avatar
    Matthieu Kermagoret authored and Matthieu Kermagoret committed
    de6a5930
    History
    Jenkinsfile 5.84 KiB
    stage('Source') {
      node {
        sh 'cd /opt/centreon-build && git pull && cd -'
        dir('centreon-web') {
          checkout scm
        }
        sh '/opt/centreon-build/jobs/web/3.4/mon-web-source.sh'
        source = readProperties file: 'source.properties'
        env.VERSION = "${source.VERSION}"
        env.RELEASE = "${source.RELEASE}"
      }
    }
    
    try {
      stage('Unit tests') {
        parallel 'centos6': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.4/mon-web-unittest.sh centos6'
          }
        },
        'centos7': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.4/mon-web-unittest.sh centos7'
            step([
              $class: 'hudson.plugins.checkstyle.CheckStylePublisher',
              pattern: 'codestyle.xml',
              usePreviousBuildAsReference: true,
              useDeltaValues: true,
              failedNewAll: '0'
            ])
          }
        }
        if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
          error('Unit tests stage failure.');
        }
      }
    
      stage('Package') {
        parallel 'centos6': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.4/mon-web-package.sh centos6'
          }
        },
        'centos7': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.4/mon-web-package.sh centos7'
          }
        }
        if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
          error('Package stage failure.');
        }
      }
    
      stage('Bundle') {
        parallel 'centos6': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.4/mon-web-bundle.sh centos6'
          }
        },
        'centos7': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.4/mon-web-bundle.sh centos7'
          }
        }
        if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
          error('Bundle stage failure.');
        }
      }
    
      stage('Critical tests') {
        parallel 'centos6': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.4/mon-web-acceptance.sh centos6 @critical'
            step([
              $class: 'XUnitBuilder',
              thresholds: [
                [$class: 'FailedThreshold', failureThreshold: '0'],
                [$class: 'SkippedThreshold', failureThreshold: '0']
              ],
              tools: [[$class: 'JUnitType', pattern: 'xunit-reports/**/*.xml']]
            ])
            archiveArtifacts allowEmptyArchive: true, artifacts: 'acceptance-logs/*.txt, acceptance-logs/*.png'
          }
        },
        'centos7': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.4/mon-web-acceptance.sh centos7 @critical'
            step([
              $class: 'XUnitBuilder',
              thresholds: [
                [$class: 'FailedThreshold', failureThreshold: '0'],
                [$class: 'SkippedThreshold', failureThreshold: '0']
              ],
              tools: [[$class: 'JUnitType', pattern: 'xunit-reports/**/*.xml']]
            ])
            archiveArtifacts allowEmptyArchive: true, artifacts: 'acceptance-logs/*.txt, acceptance-logs/*.png'
          }
        }
        if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
          error('Critical tests stage failure.');
        }
      }
    
      if (env.BRANCH_NAME == '2.8.x') {
        stage('Acceptance tests') {
          parallel 'centos6': {
            node {
              sh 'cd /opt/centreon-build && git pull && cd -'
              sh '/opt/centreon-build/jobs/web/3.4/mon-web-acceptance.sh centos6 ~@critical'
              step([
                $class: 'XUnitBuilder',
                thresholds: [
                  [$class: 'FailedThreshold', failureThreshold: '0'],
                  [$class: 'SkippedThreshold', failureThreshold: '0']
                ],
                tools: [[$class: 'JUnitType', pattern: 'xunit-reports/**/*.xml']]
              ])
              archiveArtifacts allowEmptyArchive: true, artifacts: 'acceptance-logs/*.txt, acceptance-logs/*.png'
            }
          },
          'centos7': {
            node {
              sh 'cd /opt/centreon-build && git pull && cd -'
              sh '/opt/centreon-build/jobs/web/3.4/mon-web-acceptance.sh centos7 ~@critical'
              step([
                $class: 'XUnitBuilder',
                thresholds: [
                  [$class: 'FailedThreshold', failureThreshold: '0'],
                  [$class: 'SkippedThreshold', failureThreshold: '0']
                ],
                tools: [[$class: 'JUnitType', pattern: 'xunit-reports/**/*.xml']]
              ])
              archiveArtifacts allowEmptyArchive: true, artifacts: 'acceptance-logs/*.txt, acceptance-logs/*.png'
            }
          }
          if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
            error('Critical tests stage failure.');
          }
        }
    
        stage('Delivery') {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.4/mon-web-delivery.sh'
          }
          if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
            error('Delivery stage failure.');
          }
        }
        build job: 'centreon-awie/1.0.x', wait: false
        build job: 'centreon-export/2.3.x', wait: false
        build job: 'centreon-license-manager/1.1.x', wait: false
        build job: 'centreon-poller-display/1.6.x', wait: false
        build job: 'centreon-pp-manager/2.3.x', wait: false
        build job: 'centreon-bam/3.6.x', wait: false
        build job: 'des-mbi-bundle-centos6', wait: false
        build job: 'des-mbi-bundle-centos7', wait: false
      }
    } catch(e) {
      if (env.BRANCH_NAME == '2.8.x') {
        slackSend channel: "#monitoring-metrology",
            color: "#F30031",
            message: "*FAILURE*: `CENTREON WEB` <${env.BUILD_URL}|build #${env.BUILD_NUMBER}> on branch ${env.BRANCH_NAME}\n" +
                "*COMMIT*: <https://github.com/centreon/centreon/commit/${source.COMMIT}|here> by ${source.COMMITTER}\n" +
                "*INFO*: ${e}"
      }
    
      currentBuild.result = 'FAILURE'
    }