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: |
| 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 Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 24 | force: True |
| 25 | rm: False |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 26 | with_items: "{{ docker_images }}" |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 27 | when: "{{ item.build | default(True) }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 28 | |
| 29 | - name: Build optional images |
| 30 | docker_image: |
| 31 | name: "{{ item.name }}" |
| 32 | path: "{{ item.path }}" |
| 33 | tag: "{{ build_docker_tag }}" |
| 34 | dockerfile: "{{ item.dockerfile }}" |
| 35 | pull: False |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 36 | force: True |
| 37 | rm: False |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 38 | with_items: "{{ docker_optional_images }}" |
| 39 | when: build_optional_images |
| 40 | |
| 41 | # Build extensions images |
| 42 | - name: Build xos-gui-extensions docker images |
| 43 | docker_image: |
| 44 | name: "xosproject/gui-extension-{{ item.name }}" |
| 45 | path: "{{ cord_dir }}/{{ item.path }}" |
| 46 | tag: "{{ build_docker_tag }}" |
| 47 | pull: False |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 48 | force: True |
| 49 | rm: False |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 50 | with_items: "{{ enabled_gui_extensions }}" |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 51 | |
| 52 | # Build synchronizer images |
| 53 | - name: Build synchronizer docker images |
| 54 | docker_image: |
| 55 | name: "xosproject/{{ item.name }}-synchronizer" |
| 56 | path: "{{ cord_dir }}/{{ item.path }}/xos/synchronizer" |
| 57 | dockerfile: "Dockerfile.synchronizer" |
| 58 | tag: "{{ build_docker_tag }}" |
| 59 | pull: False |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 60 | force: True |
| 61 | rm: False |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 62 | with_items: "{{ xos_services }}" |
| 63 | when: not frontend_only and item.synchronizer is defined and item.synchronizer |