Rename files under jjb from 'yml' to 'yaml'
[releng.git] / jjb / releng / compass4nfv-docker.yaml
1 ---
2 ##############################################
3 # job configuration for docker build and push
4 ##############################################
5 - project:
6
7     name: compass-docker
8
9     project: compass-containers
10
11     stream:
12       - master:
13           branch: '{stream}'
14           disabled: false
15       - euphrates:
16           branch: 'stable/{stream}'
17           disabled: true
18
19     arch_tag:
20       - 'amd64':
21           slave_label: 'opnfv-build-ubuntu'
22
23     # yamllint disable rule:key-duplicates
24     image:
25       - 'tasks'
26       - 'cobbler'
27       - 'db'
28       - 'deck'
29       - 'tasks-base'
30       - 'tasks-k8s'
31       - 'tasks-osa'
32
33     # settings for jobs run in multijob phases
34     build-job-settings: &build-job-settings
35       current-parameters: false
36       git-revision: true
37       node-parameters: false
38       predefined-parameters: |
39         PUSH_IMAGE=$PUSH_IMAGE
40         COMMIT_ID=$COMMIT_ID
41         GERRIT_REFNAME=$GERRIT_REFNAME
42         DOCKERFILE=$DOCKERFILE
43       kill-phase-on: FAILURE
44       abort-all-jobs: false
45
46     # yamllint enable rule:key-duplicates
47     jobs:
48       - "compass-docker-{stream}"
49       - "compass-{image}-build-{arch_tag}-{stream}"
50
51 ########################
52 # job templates
53 ########################
54 - job-template:
55     name: 'compass-docker-{stream}'
56
57     project-type: multijob
58
59     disabled: '{obj:disabled}'
60
61     parameters:
62       - compass-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: "*/30 * * * *"
79
80     builders:
81       - multijob:
82           name: 'build compass-tasks-base images'
83           execution-type: PARALLEL
84           projects:
85             - name: 'compass-tasks-base-build-amd64-{stream}'
86               <<: *build-job-settings
87       - multijob:
88           name: 'build all compass images'
89           condition: SUCCESSFUL
90           execution-type: PARALLEL
91           projects:
92             - name: 'compass-cobbler-build-amd64-{stream}'
93               <<: *build-job-settings
94             - name: 'compass-db-build-amd64-{stream}'
95               <<: *build-job-settings
96             - name: 'compass-deck-build-amd64-{stream}'
97               <<: *build-job-settings
98             - name: 'compass-tasks-build-amd64-{stream}'
99               <<: *build-job-settings
100             - name: 'compass-tasks-k8s-build-amd64-{stream}'
101               <<: *build-job-settings
102             - name: 'compass-tasks-osa-build-amd64-{stream}'
103               <<: *build-job-settings
104
105     publishers:
106       - 'compass-amd64-recipients'
107
108 - job-template:
109     name: 'compass-{image}-build-{arch_tag}-{stream}'
110     disabled: '{obj:disabled}'
111     parameters:
112       - compass-job-parameters:
113           project: '{project}'
114           branch: '{branch}'
115           slave_label: '{slave_label}'
116           arch_tag: '{arch_tag}'
117       - string:
118           name: DOCKER_REPO_NAME
119           default: "opnfv/compass-{image}"
120           description: "Dockerhub repo to be pushed to."
121       - string:
122           name: DOCKER_DIR
123           default: "compass-{image}"
124           description: "Directory containing files needed by the Dockerfile"
125     scm:
126       - git-scm
127     builders:
128       - shell:
129           !include-raw-escape: ./opnfv-docker.sh
130
131 # parameter macro
132 - parameter:
133     name: compass-job-parameters
134     parameters:
135       - project-parameter:
136           project: '{project}'
137           branch: '{branch}'
138       - label:
139           name: SLAVE_LABEL
140           default: '{slave_label}'
141           description: 'Slave label on Jenkins'
142       - string:
143           name: GIT_BASE
144           default: https://gerrit.opnfv.org/gerrit/$PROJECT
145           description: 'Git URL to use on this Jenkins Slave'
146       - string:
147           name: PUSH_IMAGE
148           default: "true"
149           description: "To enable/disable pushing the image to Dockerhub."
150       - string:
151           name: COMMIT_ID
152           default: ""
153           description: "commit id to make a snapshot docker image"
154       - string:
155           name: GERRIT_REFNAME
156           default: ""
157           description: "Docker tag to be built, e.g. refs/tags/5.0.0, refs/tags/opnfv-5.0.0, refs/tags/5.0.RC1"
158       - string:
159           name: DOCKERFILE
160           default: "Dockerfile"
161           description: "Dockerfile to use for creating the image."
162       - string:
163           name: ARCH_TAG
164           default: ""
165           description: "If set, this value will be added to the docker image tag as a prefix"
166       - string:
167           name: PROJECT
168           default: "{project}"
169           description: "Project name used to enable job conditions"
170
171 # publisher macros
172 - publisher:
173     name: 'compass-amd64-recipients'
174     publishers:
175       - email:
176           recipients: >
177             chigang@huawei.com
178             huangxiangyui5@huawei.com
179             xueyifei@huawei.com
180             wutianwei1@huawei.com