forked from folio-org/folio-perf-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile.public
71 lines (60 loc) · 2.58 KB
/
Jenkinsfile.public
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
#!groovy
properties([
parameters([
string(name: 'EnvName', defaultValue: 'folio-perf-test', description: 'Unique performance environment name'),
string(name: 'JenkinsAwsCredential', defaultValue: '${NEED VALUE}', description: 'Jenkins credential to access AWS account'),
string(name: 'JenkinsEc2Credential', defaultValue: '${NEED VALUE}', description: 'Jenkins credential to SSH into AWS EC2'),
string(name: 'AwsKeyPair', defaultValue: '${NEED VALUE}', description: 'Aws KeyPair name for EC2 instances'),
string(name: 'AwsSubnet', defaultValue: 'default', description: 'AWS Subnet to create EC2 instances'),
string(name: 'AwsSecurityGroups', defaultValue: 'default', description: 'AWS VPC Security Groups to use'),
string(name: 'AwsUsePublicIp', defaultValue: 'Yes', description: 'AWS EC2 has public IP or not'),
string(name: 'MdRepo', defaultValue: 'http://folio-registry.aws.indexdata.com', description: 'Module descriptor repository'),
string(name: 'StableFolio', defaultValue: 'http://folio-snapshot-stable.aws.indexdata.com', description: 'Use stable version of modules'),
string(name: 'SampleDataRepo', defaultValue: 'https://s3.amazonaws.com/folio-public-sample-data', description: 'Sample data repository'),
string(name: 'SampleDataName', defaultValue: 'perf', description: 'Sample dataset name'),
])
])
def sharedLib
def context
node {
timeout(180) {
stage("Checkout") {
cleanWs()
checkout scm
sharedLib = load "shared.groovy"
context = sharedLib.getContext()
}
withCredentials([[$class: 'AmazonWebServicesCredentialsBinding', credentialsId: "${context.awsKeyId}",
accessKeyVariable: 'AWS_ACCESS_KEY_ID', secretKeyVariable: 'AWS_SECRET_ACCESS_KEY']]) {
sshagent(credentials:["${context.sshKeyId}"]) {
try {
stage("Create Environment") {
sharedLib.createEnv(context)
}
stage("Wait for Environment") {
sharedLib.waitForEnv(context)
}
stage("Bootstrap DB") {
sharedLib.bootstrapDb(context)
}
stage("Bootstrap Okapi") {
sharedLib.bootstrapOkapi(context)
}
stage("Bootstrap modules") {
sharedLib.bootstrapModules(context)
}
stage("Populate data") {
sharedLib.populateData(context)
}
stage("Running JMeter tests") {
sharedLib.runJmeterTests(context)
}
} finally {
stage("Tear down environment") {
sharedLib.teardownEnv(context)
}
}
}
}
}
}