add instance creation process in bottlnecks jjb workflow
[releng.git] / jjb / bottlenecks / bottlenecks.yml
1 ####################################
2 # Job configuration for bottlenecks
3 ####################################
4 - project:
5     name: bottlenecks
6     jobs:
7         - 'bottlenecks-verify-{stream}'
8         - 'bottlenecks-daily-{installer}-{pod}-{stream}'
9
10     pod:
11         - lf:
12             node: 'opnfv-jump-2'
13             installer_type: 'fuel'
14             installer_ip: '10.20.0.2'
15
16     installer:
17         -fuel
18
19 # only master branch is enabled at the moment to keep no of jobs sane
20     stream:
21         - master:
22             branch: 'master'
23             gs-pathname: ''
24 #        - brahmaputra:
25 #            branch: 'stable/brahmaputra'
26 #            gs-pathname: '/brahmaputra'
27
28     project: 'bottlenecks'
29 ###############################
30 # Job templates
31 ##############################
32 - job-template:
33     name: 'bottlenecks-verify-{stream}'
34
35     parameters:
36         - project-parameter:
37             project: '{project}'
38         - gerrit-parameter:
39             branch: '{branch}'
40         - 'opnfv-build-defaults'
41
42     scm:
43         - gerrit-trigger-scm:
44             credentials-id: '{ssh-credentials}'
45             refspec: '$GERRIT_REFSPEC'
46             choosing-strategy: 'gerrit'
47
48     triggers:
49         - gerrit:
50             trigger-on:
51                 - patchset-created-event:
52                     exclude-drafts: 'false'
53                     exclude-trivial-rebase: 'false'
54                     exclude-no-code-change: 'false'
55                 - draft-published-event
56                 - comment-added-contains-event:
57                     comment-contains-value: 'recheck'
58                 - comment-added-contains-event:
59                     comment-contains-value: 'reverify'
60             projects:
61               - project-compare-type: 'ANT'
62                 project-pattern: '{project}'
63                 branches:
64                   - branch-compare-type: 'ANT'
65                     branch-pattern: '**/{branch}'
66                 forbidden-file-paths:
67                   - compare-type: ANT
68                     pattern: 'docs/**|.gitignore'
69
70     builders:
71         - shell: |
72             echo "Nothing to verify!"
73
74 - job-template:
75     name: 'bottlenecks-daily-{installer}-{pod}-{stream}'
76
77     disabled: false
78
79     node: '{node}'
80
81     parameters:
82         - project-parameter:
83             project: '{project}'
84         - 'opnfv-jump-2-defaults'
85         - string:
86             name: POD_NAME
87             default: '{pod}'
88             description: "POD where the job runs"
89         - string:
90             name: INSTALLER_TYPE
91             default: '{installer_type}'
92             description: "Installer name that is used for deployment."
93         - string:
94             name: INSTALLER_IP
95             default: '{installer_ip}'
96             description: "Installer IP."
97
98     scm:
99         - git-scm:
100             credentials-id: '{ssh-credentials}'
101             refspec: ''
102             branch: '{branch}'
103
104     triggers:
105         - 'bottlenecks-trigger-{pod}'
106
107     builders:
108         - 'bottlenecks-fetch-os-creds'
109         - 'run-rubbos-env-preparation'
110         - 'bottlenecks-instance-creation'
111         - 'run-rubbos-tools-installation'
112         - 'rubbos-exec'
113
114     publishers:
115         - email:
116             recipients: hongbo.tianhongbo@huawei.com matthew.lijun@huawei.com
117
118 ###################################
119 #builders for bottlenecks project
120 ###################################
121 - builder:
122     name: bottlenecks-fetch-os-creds
123     builders:
124         - shell:
125             !include-raw ../../utils/fetch_os_creds.sh
126
127 - builder:
128     name: run-rubbos-env-preparation
129     builders:
130         - shell: |
131             #!/bin/bash
132             set -o errexit
133
134             echo "Bottlenecks: export openstack parameters before rubbos running"
135
136             cd $WORKSPACE
137             ./rubbos/rubbos_scripts/1-1-1/scripts/env_preparation.sh
138
139 - builder:
140     name: bottlenecks-instance-creation
141     builders:
142         - shell: |
143             #!/bin/bash
144             set -o errexit
145
146             echo "Bottlenecks: instance creation by using heat template"
147             cd $WORKSPACE
148             ./utils/infra_setup/heat_template/HOT_create_instance.sh
149
150 - builder:
151     name: run-rubbos-tools-installation
152     builders:
153         - shell: |
154             #!/bin/bash
155             set -o errexit
156
157             echo "Bottlenecks: to install tools to run rubbos"
158
159             cd $WORKSPACE
160             cd rubbos/rubbos_scripts/1-1-1
161             source set_bottlenecks_rubbos_env.sh
162             ./rubbos/rubbos_scripts/1-1-1/scripts/run.sh
163
164 - builder:
165     name: rubbos-exec
166     builders:
167         - shell: |
168             #!/bin/bash
169             set -o errexit
170
171             echo "Bottlenecks: rubbos execution"
172
173             cd $WORKSPACE
174             cd ./rubbos/rubbos_scripts/1-1-1
175             source set_bottlenecks_rubbos_env.sh
176             ssh $CONTROL_HOST
177             ./tmp/CONTROL_rubbos_exec.sh
178
179 #######################
180 #trigger macros
181 #######################
182 - trigger:
183     name: 'bottlenecks-trigger-lf'
184     triggers:
185         - timed: '@midnight'