Matteo Scandolo | d2044a4 | 2017-08-07 16:08:28 -0700 | [diff] [blame] | 1 | |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 17 | --- |
| 18 | # build-images/tasks/main.yml |
| 19 | |
| 20 | - name: Clean up chameleon temp directory |
| 21 | file: |
Zack Williams | f517e40 | 2017-05-20 13:37:43 -0700 | [diff] [blame] | 22 | path: "{{ build_cord_dir }}/orchestration/xos/containers/chameleon/tmp.chameleon" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 23 | state: absent |
| 24 | with_items: "{{ chameleon_dirs }}" |
| 25 | |
| 26 | - name: Populate chameleon temp directory |
Zack Williams | f517e40 | 2017-05-20 13:37:43 -0700 | [diff] [blame] | 27 | shell: cp -a "{{ build_cord_dir }}/component/chameleon" "{{ item }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 28 | with_items: "{{ chameleon_dirs }}" |
| 29 | tags: |
| 30 | - skip_ansible_lint # docker can't access files outside of build context, so we must copy |
| 31 | |
| 32 | # If an image was previously pulled it won't get built |
| 33 | - name: Build images |
| 34 | docker_image: |
| 35 | name: "{{ item.name }}" |
| 36 | path: "{{ item.path }}" |
| 37 | tag: "{{ build_docker_tag }}" |
| 38 | dockerfile: "{{ item.dockerfile }}" |
| 39 | pull: False |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 40 | force: True |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 41 | with_items: "{{ docker_images }}" |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 42 | when: "{{ item.build | default(True) }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 43 | |
| 44 | - name: Build optional images |
| 45 | docker_image: |
| 46 | name: "{{ item.name }}" |
| 47 | path: "{{ item.path }}" |
| 48 | tag: "{{ build_docker_tag }}" |
| 49 | dockerfile: "{{ item.dockerfile }}" |
| 50 | pull: False |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 51 | force: True |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 52 | with_items: "{{ docker_optional_images }}" |
| 53 | when: build_optional_images |
| 54 | |
| 55 | # Build extensions images |
| 56 | - name: Build xos-gui-extensions docker images |
| 57 | docker_image: |
| 58 | name: "xosproject/gui-extension-{{ item.name }}" |
Zack Williams | f517e40 | 2017-05-20 13:37:43 -0700 | [diff] [blame] | 59 | path: "{{ build_cord_dir }}/{{ item.path }}" |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 60 | tag: "{{ build_docker_tag }}" |
| 61 | pull: False |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 62 | force: True |
Andy Bavier | 175cfaf | 2017-03-13 18:09:21 -0400 | [diff] [blame] | 63 | with_items: "{{ enabled_gui_extensions }}" |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 64 | |
| 65 | # Build synchronizer images |
| 66 | - name: Build synchronizer docker images |
| 67 | docker_image: |
| 68 | name: "xosproject/{{ item.name }}-synchronizer" |
Zack Williams | f517e40 | 2017-05-20 13:37:43 -0700 | [diff] [blame] | 69 | path: "{{ build_cord_dir }}/{{ item.path }}/xos/synchronizer" |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 70 | dockerfile: "Dockerfile.synchronizer" |
| 71 | tag: "{{ build_docker_tag }}" |
| 72 | pull: False |
Andy Bavier | 396f7c0 | 2017-05-03 08:52:40 -0700 | [diff] [blame] | 73 | force: True |
Andy Bavier | 7bcd283 | 2017-03-23 13:45:21 -0400 | [diff] [blame] | 74 | with_items: "{{ xos_services }}" |
Zack Williams | e5b2965 | 2017-06-02 20:11:29 -0700 | [diff] [blame] | 75 | when: not frontend_only and (item.synchronizer is not defined or item.synchronizer) |