Browse Source

Merge branch 'feature/add_optional_push_support' of ansible-roles/deploy-docker into master

tags/v1.2.2
lyz 1 year ago
parent
commit
5eb7c8ef5a
2 changed files with 11 additions and 0 deletions
  1. 1
    0
      defaults/main.yml
  2. 10
    0
      tasks/main.yml

+ 1
- 0
defaults/main.yml View File

@@ -12,3 +12,4 @@ registry_user:
12 12
 registry_password:
13 13
 docker_command:
14 14
 docker_image_tag: "{{ git_repository_tag }}"
15
+docker_push: True

+ 10
- 0
tasks/main.yml View File

@@ -27,6 +27,7 @@
27 27
   when:
28 28
     - docker_image is not defined
29 29
     - remote_build == False
30
+    - docker_push == True
30 31
 
31 32
 - name: Build docker image locally and push it to a registry with real tag
32 33
   local_action:
@@ -38,6 +39,7 @@
38 39
   when:
39 40
     - docker_image is not defined
40 41
     - remote_build == False
42
+    - docker_push == True
41 43
 
42 44
 - name: Build docker image locally and push it to a registry
43 45
   local_action:
@@ -48,6 +50,7 @@
48 50
   when:
49 51
     - docker_image is not defined
50 52
     - remote_build == False
53
+    - docker_push == True
51 54
 
52 55
 - name: Download image from public registry
53 56
   local_action:
@@ -68,6 +71,7 @@
68 71
   when:
69 72
     - docker_image is defined
70 73
     - remote_build == False
74
+    - docker_push == True
71 75
 
72 76
 - name: Push image to own registry with real tag
73 77
   local_action:
@@ -79,6 +83,7 @@
79 83
   when:
80 84
     - docker_image is defined
81 85
     - remote_build == False
86
+    - docker_push == True
82 87
 
83 88
 - name: Log remotely into private registry
84 89
   become: True
@@ -116,6 +121,7 @@
116 121
     - docker_image is not defined
117 122
     - image_exists.rc != 0
118 123
     - remote_build == True
124
+    - docker_push == True
119 125
 
120 126
 - name: Build docker image remotely and push it to a registry with real tag
121 127
   become: True
@@ -128,6 +134,7 @@
128 134
     - docker_image is not defined
129 135
     - image_exists.rc != 0
130 136
     - remote_build == True
137
+    - docker_push == True
131 138
 
132 139
 - name: Build docker image remotely and push it to a registry
133 140
   become: True
@@ -139,6 +146,7 @@
139 146
     - docker_image is not defined
140 147
     - image_exists.rc != 0
141 148
     - remote_build == True
149
+    - docker_push == True
142 150
 
143 151
 - name: Download image remotely from public registry
144 152
   become: True
@@ -159,6 +167,7 @@
159 167
   when:
160 168
     - docker_image is defined
161 169
     - remote_build == True
170
+    - docker_push == True
162 171
 
163 172
 - name: Remotely push image to own registry with real tag
164 173
   become: True
@@ -170,6 +179,7 @@
170 179
   when:
171 180
     - docker_image is defined
172 181
     - remote_build == True
182
+    - docker_push == True
173 183
 
174 184
 - name: Create systemd service
175 185
   become: True

Loading…
Cancel
Save