Skip to content

Commit 22e8dc4

Browse files
Testing the availability of various packages/tarballs on the main site (#2327)
1 parent b56e9fc commit 22e8dc4

6 files changed

+250
-0
lines changed

pbm/pbm-site-check.groovy

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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: '2.3.0',
16+
description: 'PBM Version for tests',
17+
name: 'PBM_VERSION')
18+
string(
19+
defaultValue: 'main',
20+
description: 'Branch for testing repository',
21+
name: 'TESTING_BRANCH')
22+
}
23+
stages {
24+
stage('Set build name'){
25+
steps {
26+
script {
27+
currentBuild.displayName = "${params.PBM_VERSION}"
28+
}
29+
}
30+
}
31+
stage('Checkout') {
32+
steps {
33+
deleteDir()
34+
git poll: false, branch: TESTING_BRANCH, url: 'https://github.com/Percona-QA/psmdb-testing.git'
35+
}
36+
}
37+
stage('Test') {
38+
steps {
39+
script {
40+
sh """
41+
cd site_checks
42+
docker run --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_pbm.py || [ \$? = 1 ] '
43+
"""
44+
}
45+
}
46+
}
47+
}
48+
post {
49+
success {
50+
slackNotify("#mongodb_autofeed", "#00FF00", "[${JOB_NAME}]: checking packages on the main site for PBM ${PBM_VERSION} - ok [${BUILD_URL}testReport/]")
51+
}
52+
unstable {
53+
slackNotify("#mongodb_autofeed", "#F6F930", "[${JOB_NAME}]: checking packages on the main site for PBM ${PBM_VERSION} - some links are broken [${BUILD_URL}testReport/]")
54+
}
55+
failure {
56+
slackNotify("#mongodb_autofeed", "#FF0000", "[${JOB_NAME}]: checking packages on the main site for PBM ${PBM_VERSION} - failed [${BUILD_URL}]" )
57+
}
58+
always {
59+
script {
60+
junit testResults: "**/junit.xml", keepLongStdio: true, allowEmptyResults: true, skipPublishingChecks: true
61+
sh '''
62+
sudo rm -rf ./*
63+
'''
64+
deleteDir()
65+
}
66+
}
67+
}
68+
}

pbm/pbm-site-check.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- job:
2+
name: pbm-site-check
3+
project-type: pipeline
4+
description: |
5+
Do not edit this job through the web!
6+
pipeline-scm:
7+
scm:
8+
- git:
9+
url: https://github.com/Percona-Lab/jenkins-pipelines.git
10+
branches:
11+
- 'master'
12+
wipe-workspace: false
13+
lightweight-checkout: true
14+
script-path: pbm/pbm-site-check.groovy

pdmdb/pdmdb-site-check.groovy

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
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+
}

pdmdb/pdmdb-site-check.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- job:
2+
name: pdmdb-site-check
3+
project-type: pipeline
4+
description: |
5+
Do not edit this job through the web!
6+
pipeline-scm:
7+
scm:
8+
- git:
9+
url: https://github.com/Percona-Lab/jenkins-pipelines.git
10+
branches:
11+
- 'master'
12+
wipe-workspace: false
13+
lightweight-checkout: true
14+
script-path: pdmdb/pdmdb-site-check.groovy

psmdb/psmdb-site-check.groovy

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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: '7.0.2-1',
16+
description: 'PSMDB Version for tests',
17+
name: 'PSMDB_VERSION')
18+
string(
19+
defaultValue: 'main',
20+
description: 'Branch for testing repository',
21+
name: 'TESTING_BRANCH')
22+
}
23+
stages {
24+
stage('Set build name'){
25+
steps {
26+
script {
27+
currentBuild.displayName = "${params.PSMDB_VERSION}"
28+
}
29+
}
30+
}
31+
stage('Checkout') {
32+
steps {
33+
deleteDir()
34+
git poll: false, branch: TESTING_BRANCH, url: 'https://github.com/Percona-QA/psmdb-testing.git'
35+
}
36+
}
37+
stage('Test') {
38+
steps {
39+
script {
40+
sh """
41+
cd site_checks
42+
docker run --env PSMDB_VERSION=${params.PSMDB_VERSION} --rm -v `pwd`:/tmp -w /tmp python bash -c 'pip3 install requests pytest setuptools && pytest -s --junitxml=junit.xml test_psmdb.py || [ \$? = 1 ] '
43+
"""
44+
}
45+
}
46+
}
47+
}
48+
post {
49+
success {
50+
slackNotify("#mongodb_autofeed", "#00FF00", "[${JOB_NAME}]: checking packages on the main site for PSMDB ${PSMDB_VERSION} - ok [${BUILD_URL}testReport/]")
51+
}
52+
unstable {
53+
slackNotify("#mongodb_autofeed", "#F6F930", "[${JOB_NAME}]: checking packages on the main site for PSMDB ${PSMDB_VERSION} - some links are broken [${BUILD_URL}testReport/]")
54+
}
55+
failure {
56+
slackNotify("#mongodb_autofeed", "#FF0000", "[${JOB_NAME}]: checking packages on the main site for PSMDB ${PSMDB_VERSION} - failed [${BUILD_URL}]" )
57+
}
58+
always {
59+
script {
60+
junit testResults: "**/junit.xml", keepLongStdio: true, allowEmptyResults: true, skipPublishingChecks: true
61+
sh '''
62+
sudo rm -rf ./*
63+
'''
64+
deleteDir()
65+
}
66+
}
67+
}
68+
}

psmdb/psmdb-site-check.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- job:
2+
name: psmdb-site-check
3+
project-type: pipeline
4+
description: |
5+
Do not edit this job through the web!
6+
pipeline-scm:
7+
scm:
8+
- git:
9+
url: https://github.com/Percona-Lab/jenkins-pipelines.git
10+
branches:
11+
- 'master'
12+
wipe-workspace: false
13+
lightweight-checkout: true
14+
script-path: psmdb/psmdb-site-check.groovy

0 commit comments

Comments
 (0)