summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2019-01-17 11:23:50 -0800
committerJames E. Blair <jeblair@redhat.com>2019-01-17 11:28:37 -0800
commit1c827e4761216506cd77db21b232402ff27a9332 (patch)
tree01eb7cfbfbd7bbddd84b6f7ad4f4a3791b9e79ca
parent806d901b94bbfe4cf0d9fa13e3f5b1d76f3d2d64 (diff)
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
Notes
Notes (review): Code-Review+2: Paul Belanger <pabelanger@redhat.com> Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Workflow+1: Clark Boylan <cboylan@sapwetik.org> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 17 Jan 2019 20:19:22 +0000 Reviewed-on: https://review.openstack.org/631602 Project: openstack-infra/zuul-jobs Branch: refs/heads/master
-rw-r--r--roles/build-docker-image/common.rst2
-rw-r--r--roles/build-docker-image/tasks/main.yaml2
-rw-r--r--roles/promote-docker-image/tasks/main.yaml8
-rw-r--r--roles/promote-docker-image/tasks/promote-retag.yaml4
-rw-r--r--roles/upload-docker-image/tasks/main.yaml4
5 files changed, 10 insertions, 10 deletions
diff --git a/roles/build-docker-image/common.rst b/roles/build-docker-image/common.rst
index c2c65df..4275781 100644
--- a/roles/build-docker-image/common.rst
+++ b/roles/build-docker-image/common.rst
@@ -42,7 +42,7 @@ using this role.
42 The project directory. Serves as the base for 42 The project directory. Serves as the base for
43 :zuul:rolevar:`build-docker-image.docker_images.context`. 43 :zuul:rolevar:`build-docker-image.docker_images.context`.
44 44
45.. zuul:rolevar:: credentials 45.. zuul:rolevar:: docker_credentials
46 :type: dict 46 :type: dict
47 47
48 This is only required for the upload and promote roles. This is 48 This is only required for the upload and promote roles. This is
diff --git a/roles/build-docker-image/tasks/main.yaml b/roles/build-docker-image/tasks/main.yaml
index 5db9050..795cbf7 100644
--- a/roles/build-docker-image/tasks/main.yaml
+++ b/roles/build-docker-image/tasks/main.yaml
@@ -10,4 +10,4 @@
10 --tag {{ item.repository }}:change_{{ zuul.change }} 10 --tag {{ item.repository }}:change_{{ zuul.change }}
11 args: 11 args:
12 chdir: "{{ zuul_work_dir }}/{{ item.context }}" 12 chdir: "{{ zuul_work_dir }}/{{ item.context }}"
13 loop: "{{ images }}" 13 loop: "{{ docker_images }}"
diff --git a/roles/promote-docker-image/tasks/main.yaml b/roles/promote-docker-image/tasks/main.yaml
index 025303a..0eb42de 100644
--- a/roles/promote-docker-image/tasks/main.yaml
+++ b/roles/promote-docker-image/tasks/main.yaml
@@ -5,16 +5,16 @@
5 url: "https://hub.docker.com/v2/users/login/" 5 url: "https://hub.docker.com/v2/users/login/"
6 body_format: json 6 body_format: json
7 body: 7 body:
8 username: "{{ credentials.username }}" 8 username: "{{ docker_credentials.username }}"
9 password: "{{ credentials.password }}" 9 password: "{{ docker_credentials.password }}"
10 register: jwt_token 10 register: jwt_token
11- name: Promote image 11- name: Promote image
12 loop: "{{ images }}" 12 loop: "{{ docker_images }}"
13 loop_control: 13 loop_control:
14 loop_var: image 14 loop_var: image
15 include_tasks: promote-retag.yaml 15 include_tasks: promote-retag.yaml
16- name: Delete obsolete tags 16- name: Delete obsolete tags
17 loop: "{{ images }}" 17 loop: "{{ docker_images }}"
18 loop_control: 18 loop_control:
19 loop_var: image 19 loop_var: image
20 include_tasks: promote-cleanup.yaml 20 include_tasks: promote-cleanup.yaml
diff --git a/roles/promote-docker-image/tasks/promote-retag.yaml b/roles/promote-docker-image/tasks/promote-retag.yaml
index 77b611a..255e4bd 100644
--- a/roles/promote-docker-image/tasks/promote-retag.yaml
+++ b/roles/promote-docker-image/tasks/promote-retag.yaml
@@ -2,8 +2,8 @@
2 no_log: true 2 no_log: true
3 uri: 3 uri:
4 url: "https://auth.docker.io/token?service=registry.docker.io&scope=repository:{{ image.repository }}:pull,push" 4 url: "https://auth.docker.io/token?service=registry.docker.io&scope=repository:{{ image.repository }}:pull,push"
5 user: "{{ credentials.username }}" 5 user: "{{ docker_credentials.username }}"
6 password: "{{ credentials.password }}" 6 password: "{{ docker_credentials.password }}"
7 force_basic_auth: true 7 force_basic_auth: true
8 register: token 8 register: token
9- name: Get manifest 9- name: Get manifest
diff --git a/roles/upload-docker-image/tasks/main.yaml b/roles/upload-docker-image/tasks/main.yaml
index ff49915..65be3c5 100644
--- a/roles/upload-docker-image/tasks/main.yaml
+++ b/roles/upload-docker-image/tasks/main.yaml
@@ -1,6 +1,6 @@
1- name: Log in to dockerhub 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 no_log: true 3 no_log: true
4- name: Upload to dockerhub 4- name: Upload to dockerhub
5 command: "docker push {{ item.repository }}:change_{{ zuul.change }}" 5 command: "docker push {{ item.repository }}:change_{{ zuul.change }}"
6 loop: "{{ images }}" 6 loop: "{{ docker_images }}"