Always log out of docker registry after upload
Make sure we always log out of the docker registry, as not to allow other playbooks to use the session. Change-Id: I65fb71884b08802b5537ecef7304129cdeb952c3 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
parent
feaf0f2ad5
commit
c3309e045a
@ -12,20 +12,25 @@
|
||||
command: "docker login -u {{ docker_credentials.username }} -p {{ docker_credentials.password }} {{ docker_registry }}"
|
||||
no_log: true
|
||||
|
||||
- name: Determine if we need to use buildx
|
||||
set_fact:
|
||||
use_buildx: "{{ docker_images | selectattr('arch', 'defined') | list }}"
|
||||
- name: Publish docker images
|
||||
block:
|
||||
- name: Determine if we need to use buildx
|
||||
set_fact:
|
||||
use_buildx: "{{ docker_images | selectattr('arch', 'defined') | list }}"
|
||||
|
||||
- name: Upload image to dockerhub normally
|
||||
loop: "{{ docker_images }}"
|
||||
loop_control:
|
||||
loop_var: zj_image
|
||||
include_tasks: push.yaml
|
||||
when: not use_buildx
|
||||
- name: Upload image to dockerhub normally
|
||||
loop: "{{ docker_images }}"
|
||||
loop_control:
|
||||
loop_var: zj_image
|
||||
include_tasks: push.yaml
|
||||
when: not use_buildx
|
||||
|
||||
- name: Upload image to dockerhub using buildx
|
||||
loop: "{{ docker_images }}"
|
||||
loop_control:
|
||||
loop_var: zj_image
|
||||
include_tasks: buildx.yaml
|
||||
when: use_buildx
|
||||
- name: Upload image to dockerhub using buildx
|
||||
loop: "{{ docker_images }}"
|
||||
loop_control:
|
||||
loop_var: zj_image
|
||||
include_tasks: buildx.yaml
|
||||
when: use_buildx
|
||||
always:
|
||||
- name: Log out of registry
|
||||
command: "docker logout {{ docker_registry }}"
|
||||
|
Loading…
x
Reference in New Issue
Block a user