-
Notifications
You must be signed in to change notification settings - Fork 138
/
openstack-ardana-update-and-test.Jenkinsfile
88 lines (79 loc) · 2.4 KB
/
openstack-ardana-update-and-test.Jenkinsfile
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
/**
* The openstack-ardana-update-and-test Jenkins Pipeline
*
* This job updates a pre-deployed CLM cloud and run tests.
*/
def ardana_lib = null
pipeline {
options {
// skip the default checkout, because we want to use a custom path
skipDefaultCheckout()
timestamps()
}
agent {
node {
label "cloud-ci"
customWorkspace "${JOB_NAME}-${BUILD_NUMBER}"
}
}
stages {
stage('Setup workspace') {
steps {
script {
// Set this variable to be used by upstream builds
env.blue_ocean_buildurl = env.RUN_DISPLAY_URL
if (cloud_env == '') {
error("Empty 'cloud_env' parameter value.")
}
// Parameters of the type 'extended-choice' are set to null when the job
// is automatically triggered and its default value is ''. So, we need to set
// it to '' to be able to pass it as a parameter to downstream jobs.
if (env.tempest_filter_list == null) {
env.tempest_filter_list = ''
}
if (env.qa_test_list == null) {
env.qa_test_list = ''
}
currentBuild.displayName = "#${BUILD_NUMBER}: ${cloud_env}"
sh('''
git clone $git_automation_repo --branch $git_automation_branch automation-git
''')
cloud_lib = load "$WORKSPACE/automation-git/jenkins/ci.suse.de/pipelines/openstack-cloud.groovy"
cloud_lib.load_os_params_from_resource(cloud_env)
cloud_lib.load_extra_params_as_vars(extra_params)
cloud_lib.ansible_playbook('load-job-params')
cloud_lib.ansible_playbook('setup-ssh-access')
cloud_lib.get_deployer_ip()
}
}
}
stage('Update ardana') {
steps {
script {
cloud_lib.ansible_playbook('ardana-update', "-e cloudsource=$update_to_cloudsource")
}
}
}
stage ('Prepare tests') {
when {
expression { tempest_filter_list != '' || qa_test_list != '' }
}
steps {
script {
// Generate stages for Tempest tests
cloud_lib.generate_tempest_stages(env.tempest_filter_list)
// Generate stages for QA tests
cloud_lib.generate_qa_tests_stages(env.qa_test_list)
}
}
}
}
post {
always {
archiveArtifacts artifacts: ".artifacts/**/*", allowEmptyArchive: true
}
cleanup {
cleanWs()
}
}
}