
Whenever we promote an image, delete the change tag for that image in Docker Hub, and also delete any change tags older than 24 hours in order to keep the Docker Hub image registry tidy. Change-Id: Id4654c893963bdb0a364b1132793fe4fb152bf27
23 lines
637 B
YAML
23 lines
637 B
YAML
- hosts: localhost
|
|
tasks:
|
|
# 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: "{{ credentials.username }}"
|
|
password: "{{ credentials.password }}"
|
|
register: jwt_token
|
|
- name: Promote image
|
|
loop: "{{ images }}"
|
|
loop_control:
|
|
loop_var: image
|
|
include_tasks: promote-retag.yaml
|
|
- name: Delete obsolete tags
|
|
loop: "{{ images }}"
|
|
loop_control:
|
|
loop_var: image
|
|
include_tasks: promote-delete-tag.yaml
|