blob: 212d567f81eeab1d7ed0360bcaa15202d4735f59 [file] [log] [blame]
# Copyright 2017-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
# build-images/tasks/main.yml
- name: Clean up chameleon temp directory
file:
path: "{{ build_cord_dir }}/orchestration/xos/containers/chameleon/tmp.chameleon"
state: absent
with_items: "{{ chameleon_dirs }}"
- name: Populate chameleon temp directory
shell: cp -a "{{ build_cord_dir }}/component/chameleon" "{{ item }}"
with_items: "{{ chameleon_dirs }}"
tags:
- skip_ansible_lint # docker can't access files outside of build context, so we must copy
# If an image was previously pulled it won't get built
- name: Build images
docker_image:
name: "{{ item.name }}"
path: "{{ item.path }}"
tag: "{{ build_docker_tag }}"
dockerfile: "{{ item.dockerfile }}"
pull: False
force: True
with_items: "{{ docker_images }}"
when: "{{ item.build | default(True) }}"
- name: Build optional images
docker_image:
name: "{{ item.name }}"
path: "{{ item.path }}"
tag: "{{ build_docker_tag }}"
dockerfile: "{{ item.dockerfile }}"
pull: False
force: True
with_items: "{{ docker_optional_images }}"
when: build_optional_images
# Build extensions images
- name: Build xos-gui-extensions docker images
docker_image:
name: "xosproject/gui-extension-{{ item.name }}"
path: "{{ build_cord_dir }}/{{ item.path }}"
tag: "{{ build_docker_tag }}"
pull: False
force: True
with_items: "{{ enabled_gui_extensions }}"
# Build synchronizer images
- name: Build synchronizer docker images
docker_image:
name: "xosproject/{{ item.name }}-synchronizer"
path: "{{ build_cord_dir }}/{{ item.path }}/xos/synchronizer"
dockerfile: "Dockerfile.synchronizer"
tag: "{{ build_docker_tag }}"
pull: False
force: True
with_items: "{{ xos_services }}"
when: not frontend_only and (item.synchronizer is not defined or item.synchronizer)