Skip to content

Commit

Permalink
PSMDB added package tests for gated builds (#2323)
Browse files Browse the repository at this point in the history
  • Loading branch information
olexandr-havryliak authored Oct 11, 2023
1 parent 1e60fb7 commit c6addc3
Showing 1 changed file with 33 additions and 23 deletions.
56 changes: 33 additions & 23 deletions psmdb/psmdb-parallel.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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 {
Expand All @@ -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 {
Expand Down

0 comments on commit c6addc3

Please sign in to comment.