diff --git a/psmdb/psmdb-parallel.groovy b/psmdb/psmdb-parallel.groovy index 570a370edd..be85f4bd06 100644 --- a/psmdb/psmdb-parallel.groovy +++ b/psmdb/psmdb-parallel.groovy @@ -6,14 +6,14 @@ library changelog: false, identifier: "lib@master", retriever: modernSCM([ def moleculeDir = "psmdb/psmdb" pipeline { - agent { - label 'min-centos-7-x64' - } - environment { - PATH = '/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin' - ANSIBLE_DISPLAY_SKIPPED_HOSTS = false - } - parameters { + agent { + label 'min-centos-7-x64' + } + environment { + PATH = '/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin' + ANSIBLE_DISPLAY_SKIPPED_HOSTS = false + } + parameters { choice( name: 'REPO', description: 'Repo for testing', @@ -35,15 +35,23 @@ pipeline { 'true' ] ) + choice( + name: 'GATED_BUILD', + description: 'Test private repo?', + choices: [ + 'false', + 'true' + ] + ) string( defaultValue: 'main', description: 'Branch for testing repository', name: 'TESTING_BRANCH') - } - options { - withCredentials(moleculePbmJenkinsCreds()) - disableConcurrentBuilds() - } + } + options { + withCredentials(moleculePbmJenkinsCreds()) + disableConcurrentBuilds() + } stages { stage('Checkout') { steps { @@ -52,26 +60,28 @@ pipeline { } } stage ('Prepare') { - steps { + steps { script { - installMolecule() - } - } + installMolecule() + } + } } stage('Test') { steps { - script { - moleculeParallelTest(pdmdbOperatingSystems(PSMDB_VERSION), moleculeDir) + withCredentials([usernamePassword(credentialsId: 'PSMDB_PRIVATE_REPO_ACCESS', passwordVariable: 'PASSWORD', usernameVariable: 'USERNAME')]) { + script { + moleculeParallelTest(pdmdbOperatingSystems(PSMDB_VERSION), moleculeDir) + } } } - } - } + } + } post { success { - slackNotify("#mongodb_autofeed", "#00FF00", "[${JOB_NAME}]: package tests for PSMDB ${PSMDB_VERSION} repo ${REPO} finished succesfully - [${BUILD_URL}]") + slackNotify("#mongodb_autofeed", "#00FF00", "[${JOB_NAME}]: package tests for PSMDB ${PSMDB_VERSION}, repo ${REPO}, private repo - ${GATED_BUILD} finished succesfully - [${BUILD_URL}]") } failure { - slackNotify("#mongodb_autofeed", "#FF0000", "[${JOB_NAME}]: package tests for PSMDB ${PSMDB_VERSION} repo ${REPO} failed - [${BUILD_URL}]") + slackNotify("#mongodb_autofeed", "#FF0000", "[${JOB_NAME}]: package tests for PSMDB ${PSMDB_VERSION}, repo ${REPO}, private repo - ${GATED_BUILD} failed - [${BUILD_URL}]") } always { script {