Skip to content

Commit 5cf964a

Browse files
committed
Add pushing to docker hub
1 parent d8dfe84 commit 5cf964a

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

ansible/roles/builder/tasks/main.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,22 +84,21 @@
8484
loop_var: file_name_item
8585

8686
- name: set whether image will be pushed
87+
when: git_branch | match("^v([0-9]+)\.([0-9]+)\.([0-9]+)$") and ((node_env is defined and node_env=='production-delta') or force_push_image)
8788
set_fact:
88-
push_image: >
89-
git_branch | match("^v([0-9]+)\.([0-9]+)\.([0-9]+)$") and # Is a tag
90-
((node_env is defined and node_env=="production-delta") or force_push_image) # Is prod or force_push
89+
push_image: true
9190

9291
- name: login to docker hub
9392
become: yes
94-
when: push_image
95-
command: docker login -u {{ docker_username }} -p {{ docker_password }}
93+
when: push_image is defined
94+
command: docker login -u {{ docker_hub_username }} -p {{ docker_hub_password }}
9695

9796
- name: push docker image
9897
become: yes
99-
when: push_image
98+
when: push_image is defined
10099
command: docker push {{ container_image }}:{{ container_tag }}
101100

102101
- name: logout of docker hub
103102
become: yes
104-
when: push_image
103+
when: push_image is defined
105104
command: docker logout

0 commit comments

Comments
 (0)