Merge "Temporarily disable tag cleanup in docker promote"

This commit is contained in:
Zuul 2020-07-22 15:07:37 +00:00 committed by Gerrit Code Review
commit 8c1d5d0519

View File

@ -3,18 +3,18 @@
url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags?page_size=1000" url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags?page_size=1000"
status_code: 200 status_code: 200
register: tags register: tags
- name: Set cutoff timestamp to 24 hours ago # - name: Set cutoff timestamp to 24 hours ago
command: "python3 -c \"import datetime; print((datetime.datetime.utcnow()-datetime.timedelta(days=1)).strftime('%Y-%m-%dT%H:%M:%fZ'))\"" # command: "python3 -c \"import datetime; print((datetime.datetime.utcnow()-datetime.timedelta(days=1)).strftime('%Y-%m-%dT%H:%M:%fZ'))\""
register: cutoff # register: cutoff
- name: Delete all change tags older than the cutoff # - name: Delete all change tags older than the cutoff
no_log: true # no_log: true
loop: "{{ tags.json.results }}" # loop: "{{ tags.json.results }}"
loop_control: # loop_control:
loop_var: zj_docker_tag # loop_var: zj_docker_tag
when: zj_docker_tag.last_updated < cutoff.stdout and zj_docker_tag.name.startswith('change_') # when: zj_docker_tag.last_updated < cutoff.stdout and zj_docker_tag.name.startswith('change_')
uri: # uri:
url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags/{{ zj_docker_tag.name }}/" # url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags/{{ zj_docker_tag.name }}/"
method: DELETE # method: DELETE
status_code: [200, 204] # status_code: [200, 204]
headers: # headers:
Authorization: "JWT {{ jwt_token.json.token }}" # Authorization: "JWT {{ jwt_token.json.token }}"