CORD-1401 Publish images managed by ImageBuilder
Change-Id: Ia500f1bbd2726f11874d967e56f52e0534153732
diff --git a/publish-images-playbook.yml b/publish-images-playbook.yml
new file mode 100644
index 0000000..003a24d
--- /dev/null
+++ b/publish-images-playbook.yml
@@ -0,0 +1,18 @@
+---
+# publish-platform-install-playbook.yml
+
+- name: Include vars
+ hosts: build
+ tasks:
+ - name: Include variables
+ include_vars: "{{ item }}"
+ with_items:
+ - "profile_manifests/{{ cord_profile }}.yml"
+ - profile_manifests/local_vars.yml
+ - ../ib_actions.yml
+
+- name: Publish Docker images to registry
+ hosts: build
+ roles:
+ - xos-core-publish
+ - imagebuilder-publish
diff --git a/roles/compute-node-enable-maas/defaults/main.yml b/roles/compute-node-enable-maas/defaults/main.yml
index f2b3a99..ceb2028 100644
--- a/roles/compute-node-enable-maas/defaults/main.yml
+++ b/roles/compute-node-enable-maas/defaults/main.yml
@@ -1,7 +1,7 @@
---
# compute-node-enable-maas/defaults/main.yml
-credentials_dir: "{{ playbook_dir }}/credentials"
+credentials_dir: "/opt/credentials"
head_cord_profile_dir: "/opt/cord_profile"
xos_admin_user: "xosadmin@opencord.org"
diff --git a/roles/cord-profile/templates/docker-compose.yml.j2 b/roles/cord-profile/templates/docker-compose.yml.j2
index 57cc3fe..ec16c10 100644
--- a/roles/cord-profile/templates/docker-compose.yml.j2
+++ b/roles/cord-profile/templates/docker-compose.yml.j2
@@ -159,7 +159,7 @@
restart: unless-stopped
gui_extensions_store:
- image: {{ pull_docker_registry }}node:7.9.0
+ image: {{ pull_docker_registry }}node:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
diff --git a/roles/imagebuilder-publish/tasks/main.yml b/roles/imagebuilder-publish/tasks/main.yml
new file mode 100644
index 0000000..cb80ee5
--- /dev/null
+++ b/roles/imagebuilder-publish/tasks/main.yml
@@ -0,0 +1,13 @@
+---
+- name: Remove old local images
+ docker_image:
+ name: "{{ deploy_docker_registry }}/{{ item.tags[0].split(':')[0] }}:{{ deploy_docker_tag }}"
+ state: absent
+ with_items: "{{ ib_built }} + {{ ib_pulled }}"
+
+- name: Tag and push the images managed by ImageBuilder
+ docker_image:
+ name: "{{ item.tags[0].split(':')[0] }}:{{ build_docker_tag }}"
+ repository: "{{ deploy_docker_registry }}/{{ item.tags[0].split(':')[0] }}:{{ deploy_docker_tag }}"
+ push: True
+ with_items: "{{ ib_built }} + {{ ib_pulled }}"
\ No newline at end of file
diff --git a/roles/test-exampleservice/defaults/main.yml b/roles/test-exampleservice/defaults/main.yml
index 8ec28f6..2ba4d4e 100644
--- a/roles/test-exampleservice/defaults/main.yml
+++ b/roles/test-exampleservice/defaults/main.yml
@@ -2,6 +2,7 @@
# test-exampleservice/defaults/main.yml
head_cord_profile_dir: "/opt/cord_profile"
+credentials_dir: "/opt/credentials"
xos_ui_port: 9000