summaryrefslogtreecommitdiffstats
path: root/jjb/bottlenecks/bottlenecks.yml
blob: 2ca87b0b280b8126c7a0d03e57ba1607a6750d10 (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
####################################
# Job configuration for bottlenecks
####################################
- project:
    name: bottlenecks
    jobs:
        - 'bottlenecks-verify-{stream}'
        - 'bottlenecks-daily-{installer}-{pod}-{stream}'
        - 'bottlenecks-upload-artifacts-{stream}'
    pod:
        - lf:
            node: 'opnfv-jump-2'
            installer_type: 'fuel'
            installer_ip: '10.20.0.2'

    installer:
        -fuel

# only master branch is enabled at the moment to keep no of jobs sane
    stream:
        - master:
            branch: 'master'
            gs-pathname: ''
#        - brahmaputra:
#            branch: 'stable/brahmaputra'
#            gs-pathname: '/brahmaputra'

    project: 'bottlenecks'
###############################
# Job templates
##############################
- job-template:
    name: 'bottlenecks-verify-{stream}'

    parameters:
        - project-parameter:
            project: '{project}'
        - gerrit-parameter:
            branch: '{branch}'
        - 'opnfv-build-defaults'

    scm:
        - gerrit-trigger-scm:
            credentials-id: '{ssh-credentials}'
            refspec: '$GERRIT_REFSPEC'
            choosing-strategy: 'gerrit'

    triggers:
        - gerrit:
            trigger-on:
                - patchset-created-event:
                    exclude-drafts: 'false'
                    exclude-trivial-rebase: 'false'
                    exclude-no-code-change: 'false'
                - draft-published-event
                - comment-added-contains-event:
                    comment-contains-value: 'recheck'
                - comment-added-contains-event:
                    comment-contains-value: 'reverify'
            projects:
              - project-compare-type: 'ANT'
                project-pattern: '{project}'
                branches:
                  - branch-compare-type: 'ANT'
                    branch-pattern: '**/{branch}'
                forbidden-file-paths:
                  - compare-type: ANT
                    pattern: 'docs/**|.gitignore'

    builders:
        - shell: |
            echo "Nothing to verify!"

- job-template:
    name: 'bottlenecks-upload-artifacts-{stream}'

    node: ericsson-build

    concurrent: true

    properties:
        - throttle:
            enabled: true
            max-total: 1
            max-per-node: 1

    parameters:
        - project-parameter:
            project: '{project}'
        - 'ericsson-ca-build-1-defaults'
        - bottlenecks-parameter:
            gs-pathname: '{gs-pathname}'

    scm:
        - git-scm:
            credentials-id: '{ssh-credentials}'
            refspec: ''
            branch: '{branch}'

    builders:
        - 'bottlenecks-builder-upload-artifact'
        - 'bottlenecks-workspace-cleanup'

- job-template:
    name: 'bottlenecks-daily-{installer}-{pod}-{stream}'

    disabled: false

    node: '{node}'

    parameters:
        - project-parameter:
            project: '{project}'
        - 'opnfv-jump-2-defaults'
        - string:
            name: POD_NAME
            default: '{pod}'
            description: "POD where the job runs"
        - string:
            name: INSTALLER_TYPE
            default: '{installer_type}'
            description: "Installer name that is used for deployment."
        - string:
            name: INSTALLER_IP
            default: '{installer_ip}'
            description: "Installer IP."
        - string:
            name: GERRIT_REFSPEC_DEBUG
            default: ''
            description: "Gerrit refspec for debug."

    scm:
        - git-scm:
            credentials-id: '{ssh-credentials}'
            refspec: ''
            branch: '{branch}'

    triggers:
        - 'bottlenecks-trigger-{pod}'

    builders:
        - 'bottlenecks-fetch-os-creds'
        - 'bottlenecks-run-rubbos'

    publishers:
        - email:
            recipients: hongbo.tianhongbo@huawei.com matthew.lijun@huawei.com liangqi1@huawei.com

####################
# parameter macros
####################
- parameter:
    name: bottlenecks-parameter
    parameters:
        - string:
           name: CACHE_DIR
           default: $WORKSPACE/cache
           description: "the cache to store packages downloaded from public IP"
        - string:
           name: RUBBOS_URL
           default: gs://artifacts.opnfv.org/bottlenecks/rubbos{gs-pathname}
           description: "LF artifacts url for storage of bottlenecks packages"
        - string:
           name: PACKAGE_URL
           default: http://205.177.226.235:9999/bottlenecks/rubbos/
           description: "the url where we store the packages used for bottlenecks rubbos"

###################################
#builders for bottlenecks project
###################################
- builder:
    name: bottlenecks-fetch-os-creds
    builders:
        - shell:
            !include-raw ../../utils/fetch_os_creds.sh

- builder:
    name: bottlenecks-run-rubbos
    builders:
        - shell: |
            #!/bin/bash
            set -o errexit

            echo "Bottlenecks: rubbos running now..."
            cd $WORKSPACE
            ./ci/run.sh $GERRIT_REFSPEC_DEBUG

- builder:
    name: bottlenecks-builder-upload-artifact
    builders:
        - shell: |
            #!/bin/bash
            set -o errexit

            echo "Bottlenecks: upload to artifacts from the public IP"

            [[ -d $CACHE_DIR ]] || mkdir -p $CACHE_DIR

            for file in $(curl -s $PACKAGE_URL |
                               grep href |
                               sed 's/.*href="//' |
                               sed 's/".*//' |
                               grep '^[a-zA-Z].*'); do
                 curl --connect-timeout 10 -o $CACHE_DIR/$file $PACKAGE_URL$file
                 gsutil cp $CACHE_DIR/$file $RUBBOS_URL
            done

- builder:
    name: bottlenecks-workspace-cleanup
    builders:
        - shell: |
            #!/bin/bash
            set -o errexit

            echo "Bottlenecks: cleanup cache used for storage downloaded packages"

            /bin/rm -rf $WORKSPACE

#######################
#trigger macros
#######################
- trigger:
    name: 'bottlenecks-trigger-lf'
    triggers:
        - timed: '0 6 * * *'
        - gerrit:
            trigger-on:
                - patchset-created-event:
                    exclude-drafts: 'false'
                    exclude-trivial-rebase: 'false'
                    exclude-no-code-change: 'false'
                - draft-published-event
                - comment-added-contains-event:
                    comment-contains-value: 'recheck'
                - comment-added-contains-event:
                    comment-contains-value: 'reverify'
            projects:
              - project-compare-type: 'ANT'
                project-pattern: '{project}'
                branches:
                  - branch-compare-type: 'ANT'
                    branch-pattern: '**/{branch}'
                forbidden-file-paths:
                  - compare-type: ANT
                    pattern: 'docs/**|.gitignore'