deploy/ansible/roles/deploy/tasks/main.yml
# Clone the repo and check out the specified "commit" (defaults to master)
# unless it has already been checked out. Specifying "force" will clone and
# build regardless of prior status. When done, symlink the specified commit
# to make it go live.
- name: check if specified commit has already been deployed
stat: path={{base_path}}/{{commit}} get_checksum=no get_md5=no
register: commit_dir
- include: checkout.yml
when: force or not commit_dir.stat.exists
- name: link sha-named clone to make it live
file: path={{site_path}} state=link src={{base_path}}/{{sha.stdout|default(commit)}} force=true
notify: restart site