Private GIT

Skip to content
Snippets Groups Projects
Select Git revision
  • d06f0187953ca2a0b8af85da58301b05e5d0d239
  • master default protected
  • development
  • MonTest
  • gh-pages
  • ThePirateBay
  • Pistachitos
  • custom_naming
  • dataTables
  • libdirs
  • nzbs_org_transition
  • api
  • timezones
  • adel-0002
  • adel-0001
  • build-497
  • build-496
  • build-495
  • build-494
  • build-493
  • build-492
  • build-491
  • build-490
  • build-489
  • build-488
  • build-487
  • build-486
  • build-485
  • build-484
  • build-483
  • build-482
  • build-481
  • build-480
33 results

libertalia.py

Blame
  • Jenkinsfile 7.16 KiB
    stage('Source') {
      node {
        sh 'cd /opt/centreon-build && git pull && cd -'
        dir('centreon-web') {
          checkout scm
        }
        sh '/opt/centreon-build/jobs/web/3.5/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.5/mon-web-unittest.sh centos6'
            step([
              $class: 'XUnitBuilder',
              thresholds: [
                [$class: 'FailedThreshold', failureThreshold: '0'],
                [$class: 'SkippedThreshold', failureThreshold: '0']
              ],
              tools: [[$class: 'PHPUnitJunitHudsonTestType', pattern: 'ut.xml']]
            ])
          }
        },
        'centos7': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.5/mon-web-unittest.sh centos7'
            step([
              $class: 'XUnitBuilder',
              thresholds: [
                [$class: 'FailedThreshold', failureThreshold: '0'],
                [$class: 'SkippedThreshold', failureThreshold: '0']
              ],
              tools: [[$class: 'PHPUnitJunitHudsonTestType', pattern: 'ut.xml']]
            ])
            step([
              $class: 'CloverPublisher',
              cloverReportDir: '.',
              cloverReportFileName: 'coverage.xml'
            ])
            step([
              $class: 'hudson.plugins.checkstyle.CheckStylePublisher',
              pattern: 'codestyle.xml',
              usePreviousBuildAsReference: true,
              useDeltaValues: true,
              failedNewAll: '0'
            ])
          }
        },
        'debian9': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.5/mon-web-unittest.sh debian9'
            step([
              $class: 'XUnitBuilder',
              thresholds: [
                [$class: 'FailedThreshold', failureThreshold: '0'],
                [$class: 'SkippedThreshold', failureThreshold: '0']
              ],
              tools: [[$class: 'PHPUnitJunitHudsonTestType', pattern: 'ut.xml']]
            ])
          }
        }
        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.5/mon-web-package.sh centos6'
          }
        },
        'centos7': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.5/mon-web-package.sh centos7'
          }
        },
        'debian9': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.5/mon-web-package.sh debian9'
          }
        }
        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.5/mon-web-bundle.sh centos6'
          }
        },
        'centos7': {
          node {
            sh 'cd /opt/centreon-build && git pull && cd -'
            sh '/opt/centreon-build/jobs/web/3.5/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.5/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.5/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 == 'master') {
        stage('Acceptance tests') {
          parallel 'centos6': {
            node {
              sh 'cd /opt/centreon-build && git pull && cd -'
              sh '/opt/centreon-build/jobs/web/3.5/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.5/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.5/mon-web-delivery.sh'
          }
          if ((currentBuild.result ?: 'SUCCESS') != 'SUCCESS') {
            error('Delivery stage failure.');
          }
        }
        build job: 'centreon-license-manager/master', wait: false
        build job: 'centreon-poller-display/master', wait: false
        build job: 'centreon-pp-manager/master', wait: false
        build job: 'centreon-bam/master', wait: false
        build job: 'des-mbi-bundle-centos6', wait: false
        build job: 'des-mbi-bundle-centos7', wait: false
      }
    } catch(e) {
      if (env.BRANCH_NAME == 'master' && !(${e} =~ /^.+FlowInterruptedException\$/)) {
        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'
    }