-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathJenkinsFile.Nightly
47 lines (41 loc) · 1.53 KB
/
JenkinsFile.Nightly
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
node {
// Run the Integration Tests on the Phase Two Environment
def root = pwd()
stage("Config") {
// clone the configuration repository and copy the current configuration
def configDir = "${root}/configuration"
def configFile = "${root}/config.json"
dir(configDir) {
git url: "${env.CONFIGURATION_URL}", credentialsId: "${env.CONFIGURATION_CREDS}"
sh "mv ${configDir}/${env.ENVIRONMENT}-config.json ${configFile}"
deleteDir()
}
// read the current configuration
def configJson = readJSON file: "${configFile}"
for (param in configJson.credparams + configJson.jobparams) {
env."${param.name}" = (param.type == "booleanParam") ? "${param.defaultvalue}".toBoolean() : "${param.defaultvalue}"
}
}
def pcfSpace = "${env.SPACE}"
def pcfDomain = "${env.DOMAIN}"
stage("Setup") {
deleteDir()
if(env.USE_GIT_CREDS.toBoolean()) {
git url: "${env.GIT_URL}", branch: "master", credentialsId: "${env.GITLAB_CREDS}"
} else {
git url: "${env.GIT_URL}", branch: "master"
}
}
stage("Health Check Endpoints") {
// Beachfront API
sh "curl https://bf-api.${pcfDomain}"
// Piazza
sh "curl https://piazza.${pcfDomain}"
}
stage("Selenium Tests") {
build job: "bftest-selenium", parameters: [
[$class: 'StringParameterValue', name: "SPACE", value: "${pcfSpace}"],
[$class: 'StringParameterValue', name: "DOMAIN", value: "${pcfDomain}"],
[$class: 'StringParameterValue', name: "ENVIRONMENT", value: "${ENVIRONMENT}"]]
}
}