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