File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
ansible/roles/builder/tasks Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change 23
23
accept_hostkey : yes
24
24
force : yes
25
25
26
+ - name : get new tags from remote
27
+ tags : deploy
28
+ become : true
29
+ shell : " git fetch --tags"
30
+ args :
31
+ chdir : " {{ build_dir }}/{{ name }}/repo"
32
+
33
+ - name : get latest tag name
34
+ tags : deploy
35
+ become : true
36
+ shell : " git describe --tags `git rev-list --tags --max-count=1`"
37
+ args :
38
+ chdir : " {{ build_dir }}/{{ name }}/repo"
39
+ register : latest_tag
40
+
41
+ - name : ensure latest tag is deployed
42
+ tags : deploy
43
+ fail : msg="Cannot deploy {{ git_branch }} because latest is {{latest_tag.stdout}}. Bypass with `-t i_am_deploying_an_old_tag`"
44
+ when : node_env=="production-delta" and latest_tag.stdout != git_branch and i_am_deploying_an_old_tag is not defined
45
+
26
46
- name : copy dockerfile to build folder
27
47
tags : deploy
28
48
become : true
You can’t perform that action at this time.
0 commit comments