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 | 862b0e6 | 2017-04-20 13:32:12 -0400 | [diff] [blame] | 24 | force: "{{ item.rebuild | default(False) }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 25 | 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 Bavier | 862b0e6 | 2017-04-20 13:32:12 -0400 | [diff] [blame] | 34 | force: "{{ item.rebuild | default(False) }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 35 | 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 Bavier | 862b0e6 | 2017-04-20 13:32:12 -0400 | [diff] [blame] | 45 | force: "{{ item.rebuild | default(False) }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 46 | with_items: "{{ enabled_gui_extensions }}" |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 47 | |
| 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 Bavier | 862b0e6 | 2017-04-20 13:32:12 -0400 | [diff] [blame] | 56 | force: "{{ item.rebuild | default(False) }}" |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 57 | with_items: "{{ xos_services }}" |
| 58 | when: not frontend_only and item.synchronizer is defined and item.synchronizer |