|
| 1 | +library changelog: false, identifier: "lib@master", retriever: modernSCM([ |
| 2 | + $class: 'GitSCMSource', |
| 3 | + remote: 'https://github.com/Percona-Lab/jenkins-pipelines.git' |
| 4 | +]) |
| 5 | + |
| 6 | +pipeline { |
| 7 | + agent { |
| 8 | + label 'docker' |
| 9 | + } |
| 10 | + environment { |
| 11 | + PATH = '/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin' |
| 12 | + } |
| 13 | + parameters { |
| 14 | + string( |
| 15 | + defaultValue: '6.0.9-7', |
| 16 | + description: 'PSMDB Version for tests', |
| 17 | + name: 'PSMDB_VERSION') |
| 18 | + string( |
| 19 | + defaultValue: '2.2.1', |
| 20 | + description: 'PBM Version for tests', |
| 21 | + name: 'PBM_VERSION') |
| 22 | + string( |
| 23 | + defaultValue: 'main', |
| 24 | + description: 'Branch for testing repository', |
| 25 | + name: 'TESTING_BRANCH') |
| 26 | + } |
| 27 | + stages { |
| 28 | + stage('Set build name'){ |
| 29 | + steps { |
| 30 | + script { |
| 31 | + currentBuild.displayName = "${params.PSMDB_VERSION} - ${params.PBM_VERSION}" |
| 32 | + } |
| 33 | + } |
| 34 | + } |
| 35 | + stage('Checkout') { |
| 36 | + steps { |
| 37 | + deleteDir() |
| 38 | + git poll: false, branch: TESTING_BRANCH, url: 'https://github.com/Percona-QA/psmdb-testing.git' |
| 39 | + } |
| 40 | + } |
| 41 | + stage('Test') { |
| 42 | + steps { |
| 43 | + script { |
| 44 | + sh """ |
| 45 | + cd site_checks |
| 46 | + docker run --env PSMDB_VERSION=${params.PSMDB_VERSION} --env PBM_VERSION=${params.PBM_VERSION} --rm -v `pwd`:/tmp -w /tmp python bash -c 'pip3 install requests pytest setuptools && pytest -s --junitxml=junit.xml test_pdmdb.py || [ \$? = 1 ] ' |
| 47 | + """ |
| 48 | + } |
| 49 | + } |
| 50 | + } |
| 51 | + } |
| 52 | + post { |
| 53 | + success { |
| 54 | + slackNotify("#mongodb_autofeed", "#00FF00", "[${JOB_NAME}]: checking packages on the main site for PDMDB ${PSMDB_VERSION} - ok [${BUILD_URL}testReport/]") |
| 55 | + } |
| 56 | + unstable { |
| 57 | + slackNotify("#mongodb_autofeed", "#F6F930", "[${JOB_NAME}]: checking packages on the main site for PDMDB ${PSMDB_VERSION} - some links are broken [${BUILD_URL}testReport/]") |
| 58 | + } |
| 59 | + failure { |
| 60 | + slackNotify("#mongodb_autofeed", "#FF0000", "[${JOB_NAME}]: checking packages on the main site for PDMDB ${PSMDB_VERSION} - failed [${BUILD_URL}]" ) |
| 61 | + } |
| 62 | + always { |
| 63 | + script { |
| 64 | + junit testResults: "**/junit.xml", keepLongStdio: true, allowEmptyResults: true, skipPublishingChecks: true |
| 65 | + sh ''' |
| 66 | + sudo rm -rf ./* |
| 67 | + ''' |
| 68 | + deleteDir() |
| 69 | + } |
| 70 | + } |
| 71 | + } |
| 72 | +} |
0 commit comments