blob: 923af63ad9b03e5cf9112a482b930db58a00993e [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 Bavier862b0e62017-04-20 13:32:12 -040024 force: "{{ item.rebuild | default(False) }}"
Andy Bavier175cfaf2017-03-13 18:09:21 -040025 with_items: "{{ docker_images }}"
26
27- name: Build optional images
28 docker_image:
29 name: "{{ item.name }}"
30 path: "{{ item.path }}"
31 tag: "{{ build_docker_tag }}"
32 dockerfile: "{{ item.dockerfile }}"
33 pull: False
Andy Bavier862b0e62017-04-20 13:32:12 -040034 force: "{{ item.rebuild | default(False) }}"
Andy Bavier175cfaf2017-03-13 18:09:21 -040035 with_items: "{{ docker_optional_images }}"
36 when: build_optional_images
37
38# Build extensions images
39- name: Build xos-gui-extensions docker images
40 docker_image:
41 name: "xosproject/gui-extension-{{ item.name }}"
42 path: "{{ cord_dir }}/{{ item.path }}"
43 tag: "{{ build_docker_tag }}"
44 pull: False
Andy Bavier862b0e62017-04-20 13:32:12 -040045 force: "{{ item.rebuild | default(False) }}"
Andy Bavier175cfaf2017-03-13 18:09:21 -040046 with_items: "{{ enabled_gui_extensions }}"
Andy Bavier7bcd2832017-03-23 13:45:21 -040047
48# Build synchronizer images
49- name: Build synchronizer docker images
50 docker_image:
51 name: "xosproject/{{ item.name }}-synchronizer"
52 path: "{{ cord_dir }}/{{ item.path }}/xos/synchronizer"
53 dockerfile: "Dockerfile.synchronizer"
54 tag: "{{ build_docker_tag }}"
55 pull: False
Andy Bavier862b0e62017-04-20 13:32:12 -040056 force: "{{ item.rebuild | default(False) }}"
Andy Bavier7bcd2832017-03-23 13:45:21 -040057 with_items: "{{ xos_services }}"
58 when: not frontend_only and item.synchronizer is defined and item.synchronizer