blob: a7226a989bfb37d8206d60c53777a3b3fcc5b679 [file] [log] [blame]
Andy Bavier175cfaf2017-03-13 18:09:21 -04001---
2# build-images/tasks/main.yml
3
4- name: Clean up chameleon temp directory
5 file:
6 path: "{{ cord_dir }}/orchestration/xos/containers/chameleon/tmp.chameleon"
7 state: absent
8 with_items: "{{ chameleon_dirs }}"
9
10- name: Populate chameleon temp directory
11 shell: cp -a "{{ cord_dir }}/component/chameleon" "{{ item }}"
12 with_items: "{{ chameleon_dirs }}"
13 tags:
14 - skip_ansible_lint # docker can't access files outside of build context, so we must copy
15
16# If an image was previously pulled it won't get built
17- name: Build images
18 docker_image:
19 name: "{{ item.name }}"
20 path: "{{ item.path }}"
21 tag: "{{ build_docker_tag }}"
22 dockerfile: "{{ item.dockerfile }}"
23 pull: False
Andy Bavier396f7c02017-05-03 08:52:40 -070024 force: True
Andy Bavier175cfaf2017-03-13 18:09:21 -040025 with_items: "{{ docker_images }}"
Andy Bavier396f7c02017-05-03 08:52:40 -070026 when: "{{ item.build | default(True) }}"
Andy Bavier175cfaf2017-03-13 18:09:21 -040027
28- name: Build optional images
29 docker_image:
30 name: "{{ item.name }}"
31 path: "{{ item.path }}"
32 tag: "{{ build_docker_tag }}"
33 dockerfile: "{{ item.dockerfile }}"
34 pull: False
Andy Bavier396f7c02017-05-03 08:52:40 -070035 force: True
Andy Bavier175cfaf2017-03-13 18:09:21 -040036 with_items: "{{ docker_optional_images }}"
37 when: build_optional_images
38
39# Build extensions images
40- name: Build xos-gui-extensions docker images
41 docker_image:
42 name: "xosproject/gui-extension-{{ item.name }}"
43 path: "{{ cord_dir }}/{{ item.path }}"
44 tag: "{{ build_docker_tag }}"
45 pull: False
Andy Bavier396f7c02017-05-03 08:52:40 -070046 force: True
Andy Bavier175cfaf2017-03-13 18:09:21 -040047 with_items: "{{ enabled_gui_extensions }}"
Andy Bavier7bcd2832017-03-23 13:45:21 -040048
49# Build synchronizer images
50- name: Build synchronizer docker images
51 docker_image:
52 name: "xosproject/{{ item.name }}-synchronizer"
53 path: "{{ cord_dir }}/{{ item.path }}/xos/synchronizer"
54 dockerfile: "Dockerfile.synchronizer"
55 tag: "{{ build_docker_tag }}"
56 pull: False
Andy Bavier396f7c02017-05-03 08:52:40 -070057 force: True
Andy Bavier7bcd2832017-03-23 13:45:21 -040058 with_items: "{{ xos_services }}"
59 when: not frontend_only and item.synchronizer is defined and item.synchronizer