Browse Source

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
changes/02/631602/2
James E. Blair 6 months ago
parent
commit
1c827e4761

+ 1
- 1
roles/build-docker-image/common.rst View File

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

+ 1
- 1
roles/build-docker-image/tasks/main.yaml View File

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

+ 4
- 4
roles/promote-docker-image/tasks/main.yaml View File

@@ -5,16 +5,16 @@
5 5
     url: "https://hub.docker.com/v2/users/login/"
6 6
     body_format: json
7 7
     body:
8
-      username: "{{ credentials.username }}"
9
-      password: "{{ credentials.password }}"
8
+      username: "{{ docker_credentials.username }}"
9
+      password: "{{ docker_credentials.password }}"
10 10
   register: jwt_token
11 11
 - name: Promote image
12
-  loop: "{{ images }}"
12
+  loop: "{{ docker_images }}"
13 13
   loop_control:
14 14
     loop_var: image
15 15
   include_tasks: promote-retag.yaml
16 16
 - name: Delete obsolete tags
17
-  loop: "{{ images }}"
17
+  loop: "{{ docker_images }}"
18 18
   loop_control:
19 19
     loop_var: image
20 20
   include_tasks: promote-cleanup.yaml

+ 2
- 2
roles/promote-docker-image/tasks/promote-retag.yaml View File

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

+ 2
- 2
roles/upload-docker-image/tasks/main.yaml View File

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

Loading…
Cancel
Save