-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathpsmdb-tarball-all-setups.groovy
128 lines (125 loc) · 5.07 KB
/
psmdb-tarball-all-setups.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
library changelog: false, identifier: "lib@master", retriever: modernSCM([
$class: 'GitSCMSource',
remote: 'https://github.com/Percona-Lab/jenkins-pipelines.git'
])
def moleculeDir = "psmdb-tarball/psmdb-tarball-upgrade"
def confList = [ 'single' , 'replicaset' , 'sharded' ]
def encList = [ 'NONE', 'KEYFILE', 'VAULT']
pipeline {
agent {
label 'min-bookworm-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: 'PLATFORM',
description: 'For what platform (OS) need to test',
choices: pdmdbOperatingSystems()
)
choice(
name: 'INSTANCE_TYPE',
description: 'Ec2 instance type',
choices: [
't2.micro',
't2.medium',
't2.large',
't2.xlarge'
]
)
string(
defaultValue: 'https://downloads.percona.com/downloads/percona-server-mongodb-4.2/percona-server-mongodb-4.2.15-16/binary/tarball/percona-server-mongodb-4.2.15-16-x86_64.glibc2.17-minimal.tar.gz',
description: 'URL/S3 link for tarball to upgrade/downgrade from',
name: 'OLD_TARBALL'
)
string(
defaultValue: 'https://downloads.percona.com/downloads/percona-server-mongodb-LATEST/percona-server-mongodb-4.4.8-9/binary/tarball/percona-server-mongodb-4.4.8-9-x86_64.glibc2.17-minimal.tar.gz',
description: 'URL/S3 link for tarball to upgrade/downgrade to',
name: 'NEW_TARBALL'
)
string(
defaultValue: 'main',
description: 'Branch for testing repository',
name: 'TESTING_BRANCH'
)
}
options {
withCredentials(moleculePbmJenkinsCreds())
}
stages {
stage('Set build name') {
steps {
script {
currentBuild.displayName = "${env.BUILD_NUMBER}-${env.PLATFORM}"
}
}
}
stage('Checkout') {
steps {
deleteDir()
git poll: false, branch: TESTING_BRANCH, url: 'https://github.com/Percona-QA/psmdb-testing.git'
}
}
stage ('Prepare') {
steps {
script {
installMoleculeBookworm()
}
}
}
stage ('Create virtual machines') {
steps {
script{
moleculeExecuteActionWithScenario(moleculeDir, "create", env.PLATFORM)
}
}
}
stage ('Prepare VM for test') {
steps {
script{
moleculeExecuteActionWithScenario(moleculeDir, "prepare", env.PLATFORM)
}
}
}
stage ('Run tests for all configurations') {
steps {
script {
for(conf in confList) {
for(enc in encList) {
stage("Test ${conf} with ${enc} encryption") {
script {
moleculeExecuteActionWithVariableListAndScenario(moleculeDir, "converge", env.PLATFORM, "LAYOUT_TYPE=${conf} ENCRYPTION=${enc} CIPHER=AES256-CBC PSMDB_VERSION=${params.OLD_TARBALL}")
moleculeExecuteActionWithVariableListAndScenario(moleculeDir, "verify", env.PLATFORM, "LAYOUT_TYPE=${conf} ENCRYPTION=${enc} CIPHER=AES256-CBC PSMDB_VERSION=${params.OLD_TARBALL}")
}
junit testResults: "**/*-report.xml", keepLongStdio: true
}
if (env.NEW_TARBALL != '') {
stage("Upgrade ${conf} with ${enc} encryption") {
script {
moleculeExecuteActionWithVariableListAndScenario(moleculeDir, "side-effect", env.PLATFORM, "LAYOUT_TYPE=${conf} ENCRYPTION=${enc} CIPHER=AES256-CBC PSMDB_VERSION=${params.NEW_TARBALL}")
moleculeExecuteActionWithVariableListAndScenario(moleculeDir, "verify", env.PLATFORM, "LAYOUT_TYPE=${conf} ENCRYPTION=${enc} CIPHER=AES256-CBC PSMDB_VERSION=${params.NEW_TARBALL}")
}
junit testResults: "**/*-report.xml", keepLongStdio: true
}
}
stage("Cleanup") {
script {
moleculeExecuteActionWithScenario(moleculeDir, "cleanup", env.PLATFORM)
}
}
}
}
}
}
}
}
post {
always {
script {
moleculeExecuteActionWithScenario(moleculeDir, "destroy", env.PLATFORM)
}
}
}
}