[fuel] Docker: create manifest for saltminion-maas
[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         CACHE_INVALIDATE=$CACHE_INVALIDATE
33         COMMIT_ID=$COMMIT_ID
34         GERRIT_REFNAME=$GERRIT_REFNAME
35       kill-phase-on: FAILURE
36       abort-all-jobs: false
37
38     manifest-job-settings: &manifest-job-settings
39       current-parameters: false
40       git-revision: true
41       node-parameters: false
42       predefined-parameters:
43         GERRIT_REFNAME=$GERRIT_REFNAME
44       kill-phase-on: FAILURE
45       abort-all-jobs: false
46
47     jobs:
48       - "fuel-docker-{stream}"
49       - "fuel-docker-build-{arch_tag}-{stream}"
50       - "fuel-docker-manifest-{stream}"
51
52 ########################
53 # job templates
54 ########################
55 - job-template:
56     name: 'fuel-docker-{stream}'
57
58     project-type: multijob
59
60     disabled: '{obj:disabled}'
61
62     parameters:
63       - fuel-job-parameters:
64           project: '{project}'
65           branch: '{branch}'
66           slave_label: 'opnfv-build-ubuntu'
67           arch_tag: 'amd64'
68
69     properties:
70       - throttle:
71           max-per-node: 1
72           option: 'project'
73       - build-blocker:
74           use-build-blocker: true
75           blocking-jobs:
76             - 'fuel-docker-.*'
77           blocking-level: 'NODE'
78
79     scm:
80       - git-scm
81
82     triggers:
83       - pollscm:
84           cron: "*/25 * * * *"
85       - gerrit-trigger-tag-created:
86           project: '{project}'
87
88     builders:
89       - multijob:
90           name: 'build fuel images'
91           execution-type: PARALLEL
92           projects:
93             - name: 'fuel-docker-build-amd64-{stream}'
94               <<: *build-job-settings
95             - name: 'fuel-docker-build-arm64-{stream}'
96               <<: *build-job-settings
97       - multijob:
98           name: 'publish fuel manifests'
99           condition: SUCCESSFUL
100           execution-type: PARALLEL
101           projects:
102             - name: 'fuel-docker-manifest-{stream}'
103               <<: *manifest-job-settings
104
105     publishers:
106       - email-fuel-ptl
107
108 - job-template:
109     name: 'fuel-docker-build-{arch_tag}-{stream}'
110     disabled: '{obj:disabled}'
111     parameters:
112       - fuel-job-parameters:
113           project: '{project}'
114           branch: '{branch}'
115           slave_label: '{slave_label}'
116           arch_tag: '{arch_tag}'
117     properties:
118       - build-blocker:
119           use-build-blocker: true
120           blocking-jobs:
121             - 'fuel-docker-build-.*'
122           blocking-level: 'NODE'
123     scm:
124       - git-scm
125     builders:
126       - shell: |
127           #!/bin/bash -ex
128           case "{stream}" in
129           "master")
130               tag="latest" ;;
131           *)
132               tag="{stream}" ;;
133           esac
134           ./ci/build.sh $tag
135
136 - job-template:
137     name: 'fuel-docker-manifest-{stream}'
138
139     parameters:
140       - project-parameter:
141           project: '{project}'
142           branch: '{branch}'
143       - label:
144           name: SLAVE_LABEL
145           default: 'opnfv-build-ubuntu'
146           description: 'Slave label on Jenkins'
147           all-nodes: false
148           node-eligibility: 'ignore-offline'
149       - string:
150           name: PROJECT
151           default: "{project}"
152           description: "Project name used to enable job conditions"
153       - string:
154           name: GIT_BASE
155           default: https://gerrit.opnfv.org/gerrit/$PROJECT
156           description: 'Git URL to use on this Jenkins Slave'
157       - string:
158           name: REPO
159           default: "opnfv"
160           description: "Repository name for fuel-docker images"
161
162
163     disabled: '{obj:disabled}'
164
165     builders:
166       - shell: |
167           #!/bin/bash -ex
168           case "{stream}" in
169           "master")
170               tag="latest" ;;
171           *)
172               tag="{stream}" ;;
173           esac
174           sudo manifest-tool push from-args \
175               --platforms linux/amd64,linux/arm64 \
176               --template $REPO/fuel:saltmaster-reclass-ARCH-$tag \
177               --target $REPO/fuel:saltmaster-reclass-$tag
178           sudo manifest-tool push from-args \
179               --platforms linux/amd64,linux/arm64 \
180               --template $REPO/fuel:saltminion-maas-ARCH-$tag \
181               --target $REPO/fuel:saltminion-maas-$tag
182           exit $?
183
184 # parameter macro
185 - parameter:
186     name: fuel-job-parameters
187     parameters:
188       - project-parameter:
189           project: '{project}'
190           branch: '{branch}'
191       - label:
192           name: SLAVE_LABEL
193           default: '{slave_label}'
194           description: 'Slave label on Jenkins'
195           all-nodes: false
196           node-eligibility: 'ignore-offline'
197       - string:
198           name: GIT_BASE
199           default: https://gerrit.opnfv.org/gerrit/$PROJECT
200           description: 'Git URL to use on this Jenkins Slave'
201       - string:
202           name: PUSH_IMAGE
203           default: "true"
204           description: "To enable/disable pushing the image to Dockerhub."
205       - string:
206           name: CACHE_INVALIDATE
207           default: "0"
208           description: "Set to any non-zero value to force a Docker cache cleanup"
209       - string:
210           name: COMMIT_ID
211           default: ""
212           description: "commit id to make a snapshot docker image"
213       - string:
214           name: GERRIT_REFNAME
215           default: ""
216           description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1"
217       - string:
218           name: PROJECT
219           default: "{project}"
220           description: "Project name used to enable job conditions"
221       - string:
222           name: REPO
223           default: "opnfv"
224           description: "Repository name for fuel-docker images"