aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPaul Bonaud <paul.bonaud@fretlink.com>2018-09-21 13:36:40 +0200
committerPaul Bonaud <paul.bonaud@fretlink.com>2018-09-21 13:55:09 +0200
commit19955c997637cef040850b3e2f175468f4e2799a (patch)
treec24920fb02da129b3266c377994be0c0da9ac9ba
parentd625a00570b54cd02f64ae6b11922ce9a7acaccf (diff)
downloadansible-clever-19955c997637cef040850b3e2f175468f4e2799a.tar.gz
ansible-clever-19955c997637cef040850b3e2f175468f4e2799a.tar.zst
ansible-clever-19955c997637cef040850b3e2f175468f4e2799a.zip
deploy: Make sure repo is unshallow copy before pushing to clever
If your build tool only uses a shallow clone of your project, Clever cloud will fail on first time git push. You need to git push a full clone of your git repo for the first time deployment to clever. This PR fixes that.
-rw-r--r--tasks/deploy.yml16
1 files changed, 16 insertions, 0 deletions
diff --git a/tasks/deploy.yml b/tasks/deploy.yml
index 5e773b4..4b3f48b 100644
--- a/tasks/deploy.yml
+++ b/tasks/deploy.yml
@@ -26,6 +26,22 @@
26 26
27- name: Push to Clever-Cloud to trigger deployment 27- name: Push to Clever-Cloud to trigger deployment
28 command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master" 28 command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master"
29 register: clever_git_push
30 ignore_errors: true
31 tags:
32 - skip_ansible_lint
33
34- name: First time push to Clever-Cloud needs a full git clone
35 command: "git fetch --unshallow"
36 when:
37 - clever_git_push is failed
38 - clever_git_push.stderr is search("shallow update not allowed")
39 tags:
40 - skip_ansible_lint
41
42- name: Push to Clever-Cloud to trigger deployment
43 command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master"
44 when: clever_git_push is failed
29 tags: 45 tags:
30 - skip_ansible_lint 46 - skip_ansible_lint
31 47