docker: prefix role vars

These probably should have been prefixed to start with.  The roles
are brand new, not publicised, and likely not widely used.  I think
we can merge this without announcement or deprecation.

Change-Id: I7825ef6fee1325b6d4fcc179032652eb5530d016
This commit is contained in:
James E. Blair 2019-01-17 11:23:50 -08:00
parent 806d901b94
commit 1c827e4761
5 changed files with 10 additions and 10 deletions

View File

@ -42,7 +42,7 @@ using this role.
The project directory. Serves as the base for
:zuul:rolevar:`build-docker-image.docker_images.context`.
.. zuul:rolevar:: credentials
.. zuul:rolevar:: docker_credentials
:type: dict
This is only required for the upload and promote roles. This is

View File

@ -10,4 +10,4 @@
--tag {{ item.repository }}:change_{{ zuul.change }}
args:
chdir: "{{ zuul_work_dir }}/{{ item.context }}"
loop: "{{ images }}"
loop: "{{ docker_images }}"

View File

@ -5,16 +5,16 @@
url: "https://hub.docker.com/v2/users/login/"
body_format: json
body:
username: "{{ credentials.username }}"
password: "{{ credentials.password }}"
username: "{{ docker_credentials.username }}"
password: "{{ docker_credentials.password }}"
register: jwt_token
- name: Promote image
loop: "{{ images }}"
loop: "{{ docker_images }}"
loop_control:
loop_var: image
include_tasks: promote-retag.yaml
- name: Delete obsolete tags
loop: "{{ images }}"
loop: "{{ docker_images }}"
loop_control:
loop_var: image
include_tasks: promote-cleanup.yaml

View File

@ -2,8 +2,8 @@
no_log: true
uri:
url: "https://auth.docker.io/token?service=registry.docker.io&scope=repository:{{ image.repository }}:pull,push"
user: "{{ credentials.username }}"
password: "{{ credentials.password }}"
user: "{{ docker_credentials.username }}"
password: "{{ docker_credentials.password }}"
force_basic_auth: true
register: token
- name: Get manifest

View File

@ -1,6 +1,6 @@
- name: Log in to dockerhub
command: "docker login -u {{ credentials.username }} -p {{ credentials.password }}"
command: "docker login -u {{ docker_credentials.username }} -p {{ docker_credentials.password }}"
no_log: true
- name: Upload to dockerhub
command: "docker push {{ item.repository }}:change_{{ zuul.change }}"
loop: "{{ images }}"
loop: "{{ docker_images }}"