Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 1 | --- |
| 2 | # build-images/tasks/main.yml |
| 3 | |
| 4 | - name: Clean up chameleon temp directory |
| 5 | file: |
Zack Williams | f517e40 | 2017-05-20 13:37:43 -0700 | [diff] [blame] | 6 | path: "{{ build_cord_dir }}/orchestration/xos/containers/chameleon/tmp.chameleon" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 7 | state: absent |
| 8 | with_items: "{{ chameleon_dirs }}" |
| 9 | |
| 10 | - name: Populate chameleon temp directory |
Zack Williams | f517e40 | 2017-05-20 13:37:43 -0700 | [diff] [blame] | 11 | shell: cp -a "{{ build_cord_dir }}/component/chameleon" "{{ item }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 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 Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 24 | force: True |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 25 | with_items: "{{ docker_images }}" |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 26 | when: "{{ item.build | default(True) }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 27 | |
| 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 Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 35 | force: True |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 36 | 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 }}" |
Zack Williams | f517e40 | 2017-05-20 13:37:43 -0700 | [diff] [blame] | 43 | path: "{{ build_cord_dir }}/{{ item.path }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 44 | tag: "{{ build_docker_tag }}" |
| 45 | pull: False |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 46 | force: True |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 47 | with_items: "{{ enabled_gui_extensions }}" |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 48 | |
| 49 | # Build synchronizer images |
| 50 | - name: Build synchronizer docker images |
| 51 | docker_image: |
| 52 | name: "xosproject/{{ item.name }}-synchronizer" |
Zack Williams | f517e40 | 2017-05-20 13:37:43 -0700 | [diff] [blame] | 53 | path: "{{ build_cord_dir }}/{{ item.path }}/xos/synchronizer" |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 54 | dockerfile: "Dockerfile.synchronizer" |
| 55 | tag: "{{ build_docker_tag }}" |
| 56 | pull: False |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 57 | force: True |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 58 | with_items: "{{ xos_services }}" |
Zack Williams | e5b2965 | 2017-06-02 20:11:29 -0700 | [diff] [blame] | 59 | when: not frontend_only and (item.synchronizer is not defined or item.synchronizer) |