Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions tasks/rsync-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,27 @@
path: "{{ ansistrano_deploy_to }}/{{ ansistrano_current_dir }}"

- name: ANSISTRANO | Sync release to new current path
command: rsync -a -F --no-times --delete-after "{{ ansistrano_release_path.stdout }}/" "{{ ansistrano_deploy_to }}/{{ ansistrano_current_dir }}/"
command:
argv:
- rsync
- -a
- -F
- --no-times
- --delete-after
- "{{ ansistrano_release_path.stdout }}/"
- "{{ ansistrano_deploy_to }}/{{ ansistrano_current_dir }}/"

# Ensure symlinks target paths is absent
- name: ANSISTRANO | Ensure shared paths targets are absent
file:
state: absent
path: "{{ ansistrano_deploy_to }}/{{ ansistrano_current_dir }}/{{ item }}"
with_flattened:
- "{{ ansistrano_shared_paths }}"
- "{{ ansistrano_shared_files }}"
loop: "{{ ansistrano_shared_paths + ansistrano_shared_files }}"

# Symlinks shared paths
- name: ANSISTRANO | Create softlinks for shared paths
file:
state: link
path: "{{ ansistrano_deploy_to }}/{{ ansistrano_current_dir }}/{{ item }}"
src: "{{ item | regex_replace('[^\\/]+', '..') }}/{{ ansistrano_shared_dir }}/{{ item }}"
with_flattened:
- "{{ ansistrano_shared_paths }}"
- "{{ ansistrano_shared_files }}"
loop: "{{ ansistrano_shared_paths + ansistrano_shared_files }}"
8 changes: 4 additions & 4 deletions tasks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
file:
state: directory
path: "{{ ansistrano_shared_path }}/{{ item }}"
with_items: "{{ ansistrano_shared_paths }}"
when: ansistrano_ensure_shared_paths_exist|bool
loop: "{{ ansistrano_shared_paths }}"
when: ansistrano_ensure_shared_paths_exist | bool

# Ensure basedir shared files exists
- name: ANSISTRANO | Ensure basedir shared files exists
file:
state: directory
path: "{{ ansistrano_shared_path }}/{{ item | dirname }}"
with_items: "{{ ansistrano_shared_files }}"
when: ansistrano_ensure_basedirs_shared_files_exist|bool
loop: "{{ ansistrano_shared_files }}"
when: ansistrano_ensure_basedirs_shared_files_exist | bool
7 changes: 5 additions & 2 deletions tasks/update-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
copy:
content: "{{ ansistrano_release_version }}"
dest: "{{ ansistrano_release_path.stdout }}/REVISION"
when: ansistrano_git_result is not defined or ansistrano_git_result is none
when:
- ansistrano_git_result is not defined or ansistrano_git_result is none

- name: ANSISTRANO | Copy git released version into REVISION file
copy:
content: "{{ ansistrano_git_result.after | default(ansistrano_release_version) }}"
dest: "{{ ansistrano_release_path.stdout }}/REVISION"
when: ansistrano_git_result is defined and ansistrano_git_result is not none
when:
- ansistrano_git_result is defined
- ansistrano_git_result is not none
1 change: 0 additions & 1 deletion tasks/update-code/download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
state: directory
path: "{{ ansistrano_release_path.stdout }}"

# We should be able to remove default(omit) filters and add defaults once we deprecate Ansible 1.9
- name: ANSISTRANO | download | Download artifact
get_url:
url: "{{ ansistrano_get_url }}"
Expand Down
8 changes: 7 additions & 1 deletion tasks/update-code/hg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
path: "{{ ansistrano_release_path.stdout }}"

- name: ANSISTRANO | HG | Sync repo to release path
command: "hg archive -r {{ ansistrano_hg_branch }} {{ ansistrano_release_path.stdout }}"
command:
argv:
- hg
- archive
- -r
- "{{ ansistrano_hg_branch }}"
- "{{ ansistrano_release_path.stdout }}"
args:
chdir: "{{ ansistrano_deploy_to }}/{{ ansistrano_repo_dir }}/"
7 changes: 6 additions & 1 deletion tasks/update-code/rsync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
rsync_path: "{{ ansistrano_rsync_path | default(omit) }}"

- name: ANSISTRANO | RSYNC | Deploy existing code to servers
command: cp -a {{ ansistrano_shared_rsync_copy_path.stdout }} {{ ansistrano_release_path.stdout }}
command:
argv:
- cp
- -a
- "{{ ansistrano_shared_rsync_copy_path.stdout }}"
- "{{ ansistrano_release_path.stdout }}"
3 changes: 2 additions & 1 deletion tasks/update-code/svn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
register: ansistrano_svn_result_update

- name: ANSISTRANO | SVN | Register ansistrano_svn_result variable
set_fact: ansistrano_svn_result={{ ansistrano_svn_result_update }}
set_fact:
ansistrano_svn_result: "{{ ansistrano_svn_result_update }}"

- name: ANSISTRANO | SVN | Create release folder
file:
Expand Down
Loading