aboutsummaryrefslogtreecommitdiffhomepage
path: root/tasks/redeploy.yml
blob: fbfebf3b09edec2b7c71bf604928e146dbe0c455 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
---
##################################################################
# Re-deploy only if its the first clever deploy for that project #
##################################################################

- name: First time push to Clever-Cloud needs a full git clone
  command: "git fetch --unshallow"
  args:
    chdir: "{{ clever_app_root }}"
  tags:
    - skip_ansible_lint

- name: Deploy to Clever-Cloud
  shell: "clever deploy --force"
  args:
    chdir: "{{ clever_app_root }}"
  environment:
    CONFIGURATION_FILE: "{{ clever_login_file }}"
  async: 3600 # 1 hour
  poll: 0
  ignore_errors: true
  register: clever_deploy
  tags:
    - skip_ansible_lint

- name: Wait up to 1 hour for deployment completion
  async_status:
    jid: "{{ clever_deploy.ansible_job_id }}"
  register: job_result
  until: job_result.finished
  ignore_errors: true
  delay: 30
  retries: 120 # 1 hour (120 * 30 secs delay)