-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jenkinsfile
54 lines (48 loc) · 2.22 KB
/
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
properties(
[parameters(
[string(defaultValue: 'norton.perf.lab.eng.rdu2.redhat.com', description: 'graphite host name', name: 'graphite_host'),
string(defaultValue: 'norton.perf.lab.eng.rdu2.redhat.com', description: 'grafana host name', name: 'grafana_host'),
string(defaultValue: '10.11.5.19', description: 'dns server', name: 'dns_server'),
string(defaultValue: 'neutron', description: 'List of DFGs to test', name: 'dfg_list'),
string(defaultValue: '10.9.76.205', description: 'elasticsearch host', name: 'ES_host'),
text(defaultValue: '', description: 'Extra ansible vars', name: 'extra_vars')
])
])
// workaround for first build
params.each { k, v -> env[k] = v }
node('perfci') {
checkout scm
stage('setup jetpack') {
echo 'setup jetpack'
sh 'rm -rf jetpack'
sh 'git clone https://github.com/redhat-performance/jetpack.git'
sh 'cp instackenv.json jetpack/.'
sh 'cp jetpack_all.yml jetpack/group_vars/all.yml'
}
stage('deploy osp using jetpack') {
echo 'deploy osp'
sh 'cd jetpack && ansible-playbook -vvv main.yml'
}
stage('setup browbeat') {
echo 'setup browbeat'
sh 'scp [email protected]:/home/stack/browbeat/ansible/install/group_vars/all.yml browbeat_vars.yml'
sh 'echo "graphite_host: ${graphite_host}" >> browbeat_vars.yml'
sh 'echo "grafana_host: ${grafana_host}" >> browbeat_vars.yml'
sh 'echo "dns_server: ${dns_server}" >> browbeat_vars.yml'
sh 'echo "collectd_container: false" >> browbeat_vars.yml'
sh 'ansible-playbook -vvv browbeat_install.yml'
sh 'chmod +x create-vars.sh'
sh './create-vars.sh'
}
def dfgs = params.dfg_list.split(',')
for (int i = 0; i < dfgs.length; i++) {
String dfg = dfgs[i].trim()
stage("Run ${dfg} tests") {
sh """cp ${dfg}-config-vars.yml browbeat-workload-vars.yml"""
sh """ansible-playbook prepare-config.yml"""
sh """sed -i "s/cloud_name: openstack/cloud_name: perfci-osp13-ovs-${dfg}/" browbeat-config.yaml"""
sh """echo "graphite_prefix: perfci-osp13-ovs-${dfg}" >> browbeat_vars.yml"""
sh 'ansible-playbook -vvv run_browbeat_tests.yml'
}
}
}