ok

Mini Shell

Direktori : /proc/self/root/opt/cpanel/ea-ruby27/src/passenger-release-6.0.18/dev/ci/tests/debian/
Upload File :
Current File : //proc/self/root/opt/cpanel/ea-ruby27/src/passenger-release-6.0.18/dev/ci/tests/debian/Jenkinsfile

def getDefaultDistros() {
    def distroInfo = readFile("packaging/debian/internal/lib/distro_info.sh")
    def matcher = distroInfo =~ /DEFAULT_DISTROS="(.+?)"/
    if (matcher.find()) {
        matcher.group(1).split().sort()
    } else {
        error("Unable to parse packaging/debian/internal/lib/distro_info.sh")
    }
}

def testDebianPackages(distro, params) {
  if ((!distro in params) || params[distro]) {
    node('linux') {
      def env = [
        "CACHE_DIR=${env.JENKINS_HOME}/cache/${env.JOB_NAME}/${distro}",
        "DISTRIBUTION=${distro}",
        "ARCHITECTURE=amd64"
      ]
      withEnv(env) {
        checkout scm
        sh './dev/ci/tests/debian/run'
      }
    }
  } else {
    echo 'Test skipped.'
  }
}

pipeline {
  agent { node { label 'master-pipeline' } }

  options {
    buildDiscarder(logRotator(numToKeepStr: '10'))
    timeout(time: 45, unit: 'MINUTES')
    disableConcurrentBuilds()
    timestamps()
  }

  parameters {
    booleanParam(name: 'bionic', defaultValue: true, description: 'Test Ubuntu 18.04 packages')
    booleanParam(name: 'focal',  defaultValue: true, description: 'Test Ubuntu 20.04 packages')
    booleanParam(name: 'jammy',  defaultValue: true, description: 'Test Ubuntu 22.04 packages')
    booleanParam(name: 'lunar',  defaultValue: true, description: 'Test Ubuntu 23.04 packages')

    booleanParam(name: 'buster',  defaultValue: true, description: 'Test Debian 10 packages')
    booleanParam(name: 'bullseye',defaultValue: true, description: 'Test Debian 11 packages')
  }

  stages {
    stage('Initialize') {
      steps {
        script {
          if (env.JOB_NAME.indexOf('Enterprise') != -1) {
            env.ENTERPRISE = '1'
          } else {
            env.ENTERPRISE = '0'
          }

          // For debugging purposes
          sh 'env | sort'
        }
      }
    }



    stage('Test') {
      steps {
        script {
          def defaultDistros = getDefaultDistros()
          def i
          def parallelSteps = [:]

          // We use a plain loop over .each because of this bug:
          // https://issues.jenkins-ci.org/browse/JENKINS-27421
          for (i = 0; i < defaultDistros.length; i++) {
            def distro = defaultDistros[i]
            parallelSteps[distro] = {
              testDebianPackages(distro, params)
            }
          }

          parallel(parallelSteps)
        }
      }
    }
  }
}

Zerion Mini Shell 1.0