61a76f95f0
This should make this step more robust to remote failures. Change-Id: I3f3d643ac5285027bda909ac6d55d8959a4b4f79
31 lines
908 B
YAML
31 lines
908 B
YAML
- name: Verify repository names
|
|
when: |
|
|
docker_credentials.repository is defined
|
|
and not item.repository | regex_search(docker_credentials.repository)
|
|
loop: "{{ docker_images }}"
|
|
fail:
|
|
msg: "{{ item.repository }} not permitted by {{ docker_credentials.repository }}"
|
|
# This is used by the delete tasks
|
|
- name: Get dockerhub JWT token
|
|
no_log: true
|
|
uri:
|
|
url: "https://hub.docker.com/v2/users/login/"
|
|
body_format: json
|
|
body:
|
|
username: "{{ docker_credentials.username }}"
|
|
password: "{{ docker_credentials.password }}"
|
|
register: jwt_token
|
|
delay: 5
|
|
retries: 3
|
|
until: jwt_token and jwt_token.status==200
|
|
- name: Promote image
|
|
loop: "{{ docker_images }}"
|
|
loop_control:
|
|
loop_var: image
|
|
include_tasks: promote-retag.yaml
|
|
- name: Delete obsolete tags
|
|
loop: "{{ docker_images }}"
|
|
loop_control:
|
|
loop_var: image
|
|
include_tasks: promote-cleanup.yaml
|