Merge "Revert "CPERF: Fix csit odltools install""
[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: true
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           sudo ./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       - string:
136           name: PROJECT
137           default: "{project}"
138           description: "Project name used to enable job conditions"
139       - string:
140           name: GIT_BASE
141           default: https://gerrit.opnfv.org/gerrit/$PROJECT
142           description: 'Git URL to use on this Jenkins Slave'
143       - string:
144           name: REPO
145           default: "opnfv"
146           description: "Repository name for fuel-docker images"
147
148
149     disabled: '{obj:disabled}'
150
151     builders:
152       - shell: |
153           #!/bin/bash -ex
154           case "{stream}" in
155           "master")
156               tag="latest" ;;
157           *)
158               tag="{stream}" ;;
159           esac
160           sudo manifest-tool push from-args \
161               --platforms linux/amd64,linux/arm64 \
162               --template $REPO/fuel:saltmaster-reclass-ARCH-$tag \
163               --target $REPO/fuel:saltmaster-reclass-$tag
164           exit $?
165
166 # parameter macro
167 - parameter:
168     name: fuel-job-parameters
169     parameters:
170       - project-parameter:
171           project: '{project}'
172           branch: '{branch}'
173       - label:
174           name: SLAVE_LABEL
175           default: '{slave_label}'
176           description: 'Slave label on Jenkins'
177       - string:
178           name: GIT_BASE
179           default: https://gerrit.opnfv.org/gerrit/$PROJECT
180           description: 'Git URL to use on this Jenkins Slave'
181       - string:
182           name: PUSH_IMAGE
183           default: "true"
184           description: "To enable/disable pushing the image to Dockerhub."
185       - string:
186           name: COMMIT_ID
187           default: ""
188           description: "commit id to make a snapshot docker image"
189       - string:
190           name: GERRIT_REFNAME
191           default: ""
192           description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1"
193       - string:
194           name: PROJECT
195           default: "{project}"
196           description: "Project name used to enable job conditions"
197       - string:
198           name: REPO
199           default: "opnfv"
200           description: "Repository name for fuel-docker images"