blob: 212d567f81eeab1d7ed0360bcaa15202d4735f59 [file] [log] [blame]
Matteo Scandolod2044a42017-08-07 16:08:28 -07001
2# Copyright 2017-present Open Networking Foundation
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
16
Andy Bavier175cfaf2017-03-13 18:09:21 -040017---
18# build-images/tasks/main.yml
19
20- name: Clean up chameleon temp directory
21 file:
Zack Williamsf517e402017-05-20 13:37:43 -070022 path: "{{ build_cord_dir }}/orchestration/xos/containers/chameleon/tmp.chameleon"
Andy Bavier175cfaf2017-03-13 18:09:21 -040023 state: absent
24 with_items: "{{ chameleon_dirs }}"
25
26- name: Populate chameleon temp directory
Zack Williamsf517e402017-05-20 13:37:43 -070027 shell: cp -a "{{ build_cord_dir }}/component/chameleon" "{{ item }}"
Andy Bavier175cfaf2017-03-13 18:09:21 -040028 with_items: "{{ chameleon_dirs }}"
29 tags:
30 - skip_ansible_lint # docker can't access files outside of build context, so we must copy
31
32# If an image was previously pulled it won't get built
33- name: Build images
34 docker_image:
35 name: "{{ item.name }}"
36 path: "{{ item.path }}"
37 tag: "{{ build_docker_tag }}"
38 dockerfile: "{{ item.dockerfile }}"
39 pull: False
Andy Bavier396f7c02017-05-03 08:52:40 -070040 force: True
Andy Bavier175cfaf2017-03-13 18:09:21 -040041 with_items: "{{ docker_images }}"
Andy Bavier396f7c02017-05-03 08:52:40 -070042 when: "{{ item.build | default(True) }}"
Andy Bavier175cfaf2017-03-13 18:09:21 -040043
44- name: Build optional images
45 docker_image:
46 name: "{{ item.name }}"
47 path: "{{ item.path }}"
48 tag: "{{ build_docker_tag }}"
49 dockerfile: "{{ item.dockerfile }}"
50 pull: False
Andy Bavier396f7c02017-05-03 08:52:40 -070051 force: True
Andy Bavier175cfaf2017-03-13 18:09:21 -040052 with_items: "{{ docker_optional_images }}"
53 when: build_optional_images
54
55# Build extensions images
56- name: Build xos-gui-extensions docker images
57 docker_image:
58 name: "xosproject/gui-extension-{{ item.name }}"
Zack Williamsf517e402017-05-20 13:37:43 -070059 path: "{{ build_cord_dir }}/{{ item.path }}"
Andy Bavier175cfaf2017-03-13 18:09:21 -040060 tag: "{{ build_docker_tag }}"
61 pull: False
Andy Bavier396f7c02017-05-03 08:52:40 -070062 force: True
Andy Bavier175cfaf2017-03-13 18:09:21 -040063 with_items: "{{ enabled_gui_extensions }}"
Andy Bavier7bcd2832017-03-23 13:45:21 -040064
65# Build synchronizer images
66- name: Build synchronizer docker images
67 docker_image:
68 name: "xosproject/{{ item.name }}-synchronizer"
Zack Williamsf517e402017-05-20 13:37:43 -070069 path: "{{ build_cord_dir }}/{{ item.path }}/xos/synchronizer"
Andy Bavier7bcd2832017-03-23 13:45:21 -040070 dockerfile: "Dockerfile.synchronizer"
71 tag: "{{ build_docker_tag }}"
72 pull: False
Andy Bavier396f7c02017-05-03 08:52:40 -070073 force: True
Andy Bavier7bcd2832017-03-23 13:45:21 -040074 with_items: "{{ xos_services }}"
Zack Williamse5b29652017-06-02 20:11:29 -070075 when: not frontend_only and (item.synchronizer is not defined or item.synchronizer)