Fix incorrect variable name for promote-docker-image

The variable was changed inside the role from image to zj_image but the
included task file did not use the new variable name.  This patch fixes
this.

Change-Id: Ibe3acbd0881da24ec9c2f636d777885a309bdf98
This commit is contained in:
Mohammed Naser 2020-04-29 20:04:09 -04:00
parent d0e2016592
commit 5b37cabf41
3 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,6 @@
- name: List tags - name: List tags
uri: uri:
url: "https://hub.docker.com/v2/repositories/{{ 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
@ -13,7 +13,7 @@
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/{{ 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:

View File

@ -1,7 +1,7 @@
- name: Get manifest - name: Get manifest
no_log: true no_log: true
uri: uri:
url: "https://registry.hub.docker.com/v2/{{ image.repository }}/manifests/change_{{ zuul.change }}_{{ image_tag }}" url: "https://registry.hub.docker.com/v2/{{ zj_image.repository }}/manifests/change_{{ zuul.change }}_{{ image_tag }}"
status_code: 200 status_code: 200
headers: headers:
Accept: "application/vnd.docker.distribution.manifest.v2+json" Accept: "application/vnd.docker.distribution.manifest.v2+json"
@ -11,7 +11,7 @@
- name: Put manifest - name: Put manifest
no_log: true no_log: true
uri: uri:
url: "https://registry.hub.docker.com/v2/{{ image.repository }}/manifests/{{ image_tag }}" url: "https://registry.hub.docker.com/v2/{{ zj_image.repository }}/manifests/{{ image_tag }}"
method: PUT method: PUT
status_code: 201 status_code: 201
body: "{{ manifest.content | string }}" body: "{{ manifest.content | string }}"
@ -21,7 +21,7 @@
- name: Delete the current change tag - name: Delete the current change tag
no_log: true no_log: true
uri: uri:
url: "https://hub.docker.com/v2/repositories/{{ image.repository }}/tags/change_{{ zuul.change }}_{{ image_tag }}/" url: "https://hub.docker.com/v2/repositories/{{ zj_image.repository }}/tags/change_{{ zuul.change }}_{{ image_tag }}/"
method: DELETE method: DELETE
status_code: [200,204] status_code: [200,204]
headers: headers:

View File

@ -7,7 +7,7 @@
force_basic_auth: true force_basic_auth: true
register: token register: token
- name: Retag image - name: Retag image
loop: "{{ image.tags | default(['latest']) }}" loop: "{{ zj_image.tags | default(['latest']) }}"
loop_control: loop_control:
loop_var: image_tag loop_var: image_tag
include_tasks: promote-retag-inner.yaml include_tasks: promote-retag-inner.yaml