blob: 52b95e0f5a5cda5868570edd341914f153a3b8ec [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.
---
# publish-xos-docker-images/tasks/main.yml
# Remove the old local images to force them to be re-pushed
- name: Remove old local XOS images
docker_image:
name: "{{ deploy_docker_registry }}/{{ item.name }}:{{ deploy_docker_tag }}"
state: absent
with_items: "{{ docker_images | selectattr('publish') | list }}"
- name: Tag and push locally built images to docker registry
docker_image:
name: "{{ item.name }}:{{ deploy_docker_tag }}"
repository: "{{ deploy_docker_registry }}/{{ item.name }}:{{ deploy_docker_tag }}"
push: True
with_items: "{{ docker_images | selectattr('publish') | list }}"
# Remove the old local images to force them to be re-pushed
- name: Remove old local XOS GUI extension images
docker_image:
name: "{{ deploy_docker_registry }}/xosproject/gui-extension-{{ item.name }}:{{ deploy_docker_tag }}"
state: absent
with_items: "{{ enabled_gui_extensions }}"
- name: Tag and push locally built images to docker registry
docker_image:
name: "xosproject/gui-extension-{{ item.name }}:{{ deploy_docker_tag }}"
repository: "{{ deploy_docker_registry }}/xosproject/gui-extension-{{ item.name }}:{{ deploy_docker_tag }}"
push: True
with_items: "{{ enabled_gui_extensions }}"
# Remove the old local images to force them to be re-pushed
- name: Remove old local synchronizer images
docker_image:
name: "{{ deploy_docker_registry }}/xosproject/{{ item.name }}-synchronizer:{{ deploy_docker_tag }}"
state: absent
with_items: "{{ xos_services }}"
- name: Tag and push locally built synchronizer images to docker registry
docker_image:
name: "xosproject/{{ item.name }}-synchronizer:{{ deploy_docker_tag }}"
repository: "{{ deploy_docker_registry }}/xosproject/{{ item.name }}-synchronizer:{{ deploy_docker_tag }}"
push: True
with_items: "{{ xos_services }}"
when: not frontend_only and (item.synchronizer is not defined or item.synchronizer)
# Remove the old local images to force them to be re-pushed
- name: Remove old local miscellaneous images
docker_image:
name: "{{ deploy_docker_registry }}/{{ item }}"
state: absent
with_items: "{{ misc_docker_images }}"
# Just needed for onboarding, will go away
- name: Tag and push miscellaneous images
docker_image:
name: "{{ item }}"
repository: "{{ deploy_docker_registry }}/{{ item }}"
push: True
with_items: "{{ misc_docker_images }}"