aboutsummaryrefslogblamecommitdiffhomepage
path: root/tasks/deploy.yml
blob: 54c04ac06879936595394dc7794fa9810f8c2386 (plain) (tree)

























                                                                                                                                                
                               
                                


                        

                                                 








                                            
- name: Configure Drain
  when: syslog_server is defined
  command: clever-set-drain.sh
  environment:
    SYSLOG_UDP_SERVER: "{{ syslog_server }}"
    CONFIGURATION_FILE: "{{ clever_login_file }}"

- name: Configure Domain
  when: domain is defined
  command: clever-set-domain.sh
  environment:
    DOMAIN: "{{ domain }}"
    CONFIGURATION_FILE: "{{ clever_login_file }}"

- name: Push Environment
  shell: "clever env import < {{ clever_app_confdir }}/env"
  environment:
    CONFIGURATION_FILE: "{{ clever_login_file }}"

#TODO: Improve ssh-key validation
- name: Accept Clever-Cloud servers
  shell: "ssh-keyscan -H push-par-clevercloud-customers.services.clever-cloud.com >> ~/.ssh/known_hosts"

- name: Push to Clever-Cloud to trigger deployment
  command: "git push --force git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/{{ clever_app }}.git HEAD:refs/heads/master"

- name: Watch deployment status
  command: clever-wait-deploy.sh
  async: 900
  poll: 0
  register: long_command
  environment:
    CONFIGURATION_FILE: "{{ clever_login_file }}"

# Waits up to 15 minutes
- name: Wait for deployment completion
  async_status:
    jid: "{{ long_command.ansible_job_id }}"
  register: job_result
  until: job_result.finished
  delay: 30
  retries: 30