Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in setup.yml, adding cleanup tasks for any previous incomplete deploys #209

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions tasks/setup.yml
Expand Up @@ -30,3 +30,15 @@
path: "{{ ansistrano_deploy_to }}/shared/{{ item | dirname }}"
with_items: "{{ ansistrano_shared_files }}"
when: ansistrano_ensure_basedirs_shared_files_exist

# Ensure no deploys exist that are later than what current points to.
# They are probably previously failed deploys and it would be dangerous
# to allow them to exist, since they can be rolled back to.
- name: ANSISTRANO | get current release name
shell: test -L {{ansistrano_deploy_to}}/{{ansistrano_current_dir}} && readlink -f {{ansistrano_deploy_to}}/{{ansistrano_current_dir}}
register: ansistrano_old_current
ignore_errors: true
- name: ANSISTRANO | delete previous incomplete deploys
shell: find {{ansistrano_deploy_to}}/{{ansistrano_version_dir}}/* -maxdepth 0 -newer {{ansistrano_old_current.stdout}} -exec rm -rf "{}" \;
when: ansistrano_old_current.rc == 0

1 change: 1 addition & 0 deletions test/setup.yml
Expand Up @@ -38,3 +38,4 @@
- git
- unzip
- subversion
- findutils