Merge "Adding a new verification job for testapi UI."
[releng.git] / jjb / fuel / fuel-docker-jobs.yaml
1 ---
2 ##############################################
3 # job configuration for docker build and push
4 ##############################################
5 - project:
6
7     name: fuel-docker
8
9     project: fuel
10
11     stream:
12       - master:
13           branch: '{stream}'
14           disabled: false
15       - gambia:
16           branch: 'stable/{stream}'
17           disabled: false
18
19     arch_tag:
20       - 'amd64':
21           slave_label: 'opnfv-build-ubuntu'
22       - 'arm64':
23           slave_label: 'opnfv-build-ubuntu-arm'
24
25     # settings for jobs run in multijob phases
26     build-job-settings: &build-job-settings
27       current-parameters: false
28       git-revision: true
29       node-parameters: false
30       predefined-parameters: |
31         PUSH_IMAGE=$PUSH_IMAGE
32         COMMIT_ID=$COMMIT_ID
33         GERRIT_REFNAME=$GERRIT_REFNAME
34       kill-phase-on: FAILURE
35       abort-all-jobs: false
36
37     manifest-job-settings: &manifest-job-settings
38       current-parameters: false
39       git-revision: true
40       node-parameters: false
41       predefined-parameters:
42         GERRIT_REFNAME=$GERRIT_REFNAME
43       kill-phase-on: FAILURE
44       abort-all-jobs: false
45
46     jobs:
47       - "fuel-docker-{stream}"
48       - "fuel-docker-build-{arch_tag}-{stream}"
49       - "fuel-docker-manifest-{stream}"
50
51 ########################
52 # job templates
53 ########################
54 - job-template:
55     name: 'fuel-docker-{stream}'
56
57     project-type: multijob
58
59     disabled: '{obj:disabled}'
60
61     parameters:
62       - fuel-job-parameters:
63           project: '{project}'
64           branch: '{branch}'
65           slave_label: 'opnfv-build-ubuntu'
66           arch_tag: 'amd64'
67
68     properties:
69       - throttle:
70           max-per-node: 1
71           option: 'project'
72
73     scm:
74       - git-scm
75
76     triggers:
77       - pollscm:
78           cron: "*/25 * * * *"
79       - gerrit-trigger-tag-created:
80           project: '{project}'
81
82     builders:
83       - multijob:
84           name: 'build fuel images'
85           execution-type: PARALLEL
86           projects:
87             - name: 'fuel-docker-build-amd64-{stream}'
88               <<: *build-job-settings
89             - name: 'fuel-docker-build-arm64-{stream}'
90               <<: *build-job-settings
91       - multijob:
92           name: 'publish fuel manifests'
93           condition: SUCCESSFUL
94           execution-type: PARALLEL
95           projects:
96             - name: 'fuel-docker-manifest-{stream}'
97               <<: *manifest-job-settings
98
99     publishers:
100       - email-fuel-ptl
101
102 - job-template:
103     name: 'fuel-docker-build-{arch_tag}-{stream}'
104     disabled: '{obj:disabled}'
105     parameters:
106       - fuel-job-parameters:
107           project: '{project}'
108           branch: '{branch}'
109           slave_label: '{slave_label}'
110           arch_tag: '{arch_tag}'
111     scm:
112       - git-scm
113     builders:
114       - shell: |
115           #!/bin/bash -ex
116           case "{stream}" in
117           "master")
118               tag="latest" ;;
119           *)
120               tag="{stream}" ;;
121           esac
122           ./ci/build.sh $tag
123
124 - job-template:
125     name: 'fuel-docker-manifest-{stream}'
126
127     parameters:
128       - project-parameter:
129           project: '{project}'
130           branch: '{branch}'
131       - label:
132           name: SLAVE_LABEL
133           default: 'opnfv-build-ubuntu'
134           description: 'Slave label on Jenkins'
135           all-nodes: false
136           node-eligibility: 'ignore-offline'
137       - string:
138           name: PROJECT
139           default: "{project}"
140           description: "Project name used to enable job conditions"
141       - string:
142           name: GIT_BASE
143           default: https://gerrit.opnfv.org/gerrit/$PROJECT
144           description: 'Git URL to use on this Jenkins Slave'
145       - string:
146           name: REPO
147           default: "opnfv"
148           description: "Repository name for fuel-docker images"
149
150
151     disabled: '{obj:disabled}'
152
153     builders:
154       - shell: |
155           #!/bin/bash -ex
156           case "{stream}" in
157           "master")
158               tag="latest" ;;
159           *)
160               tag="{stream}" ;;
161           esac
162           sudo manifest-tool push from-args \
163               --platforms linux/amd64,linux/arm64 \
164               --template $REPO/fuel:saltmaster-reclass-ARCH-$tag \
165               --target $REPO/fuel:saltmaster-reclass-$tag
166           exit $?
167
168 # parameter macro
169 - parameter:
170     name: fuel-job-parameters
171     parameters:
172       - project-parameter:
173           project: '{project}'
174           branch: '{branch}'
175       - label:
176           name: SLAVE_LABEL
177           default: '{slave_label}'
178           description: 'Slave label on Jenkins'
179           all-nodes: false
180           node-eligibility: 'ignore-offline'
181       - string:
182           name: GIT_BASE
183           default: https://gerrit.opnfv.org/gerrit/$PROJECT
184           description: 'Git URL to use on this Jenkins Slave'
185       - string:
186           name: PUSH_IMAGE
187           default: "true"
188           description: "To enable/disable pushing the image to Dockerhub."
189       - string:
190           name: COMMIT_ID
191           default: ""
192           description: "commit id to make a snapshot docker image"
193       - string:
194           name: GERRIT_REFNAME
195           default: ""
196           description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1"
197       - string:
198           name: PROJECT
199           default: "{project}"
200           description: "Project name used to enable job conditions"
201       - string:
202           name: REPO
203           default: "opnfv"
204           description: "Repository name for fuel-docker images"