summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMichaƂ Nasiadka <mnasiadka@gmail.com>2020-11-18 10:53:46 +0100
committerMichal Nasiadka <mnasiadka@gmail.com>2020-11-19 10:34:20 +0000
commit3ad0c1212978fba797c79cf1017c293a8839b7be (patch)
treecd378cbad2ad0cb93bd52603276c3f8196239e76 /tests
parentbb12d8ac60cb8ca66dbf13b49a0dd1a844cde6a3 (diff)
downloadkolla-3ad0c1212978fba797c79cf1017c293a8839b7be.tar.gz
kolla-3ad0c1212978fba797c79cf1017c293a8839b7be.zip
CI: Improve publish playbook
Currently we use a for loop in shell that performs push of images to Docker Hub - that doesn't really seem to fail properly on push errors (e.g. related to new Docker Hub limits). This change introduces usage of Ansible docker_* modules for doing the same job and improves logging (so it's easier to find out which image failed to publish). Change-Id: I083ce70772edd1abb873ad43f6beb73aae01383f
Diffstat (limited to 'tests')
-rw-r--r--tests/playbooks/publish.yml18
1 files changed, 15 insertions, 3 deletions
diff --git a/tests/playbooks/publish.yml b/tests/playbooks/publish.yml
index 9a019fac9..212d572ea 100644
--- a/tests/playbooks/publish.yml
+++ b/tests/playbooks/publish.yml
@@ -1,8 +1,20 @@
---
- hosts: all
tasks:
+ - name: List all containers
+ docker_host_info:
+ images: yes
+ images_filters:
+ reference: "kolla/*"
+ register: docker_host_info
+
- name: Login to Dockerhub
- command: "docker login -u {{ kolla_dockerhub_creds.user }} -p {{ kolla_dockerhub_creds.password }}"
- no_log: true
+ docker_login:
+ username: "{{ kolla_dockerhub_creds.user }}"
+ password: "{{ kolla_dockerhub_creds.password }}"
- - shell: "for img in $(docker images --format '{% raw %}{{ .Repository }}:{{ .Tag }}{% endraw %}' | grep kolla ); do docker push $img; done"
+ - name: Push built container images
+ docker_image:
+ name: "{{ item.RepoTags.0 }}"
+ push: yes
+ loop: "{{ docker_host_info.images }}"