ansistrano / deploy

Ansible role to deploy scripting applications like PHP, Python, Ruby, etc. in a capistrano style
https://ansistrano.com
MIT License
2.37k stars 343 forks source link

Provide a rsync strategy without copying from shared path to release path #243

Closed nixelsolutions closed 4 years ago

nixelsolutions commented 7 years ago

We have modified rsync strategy to this:

---
- name: ANSISTRANO | RSYNC | Get Release path (in rsync case)
  command: echo "{{ ansistrano_release_path.stdout }}"
  register: ansistrano_release_rsync_copy_path

- name: ANSISTRANO | RSYNC | Rsync application files to remote release path
  synchronize:
    src: "{{ ansistrano_deploy_from }}"
    dest: "{{ ansistrano_release_rsync_copy_path.stdout }}"
    set_remote_user: "{{ ansistrano_rsync_set_remote_user }}"
    recursive: yes
    delete: yes
    archive: yes
    compress: yes
    rsync_opts: "{{ ansistrano_rsync_extra_params }}"

This is very useful because the copy to remote servers is just one rsync command, directly to release path in remote server. This way we don't cp from shared path to remote path, as we don't need to. Even more, our disks have very poor read performance, which caused "cp" to take more than 30mins to complete. With this the remote copy only takes 2mins.

Would be very nice if you could add another rsync strategy like this which doesn't use cp command, but directly syncs to release path.

ricardclau commented 7 years ago

wow, this is really bad performance, we use t2.micros for our test environment and performance is relatively decent compared to this!

Happy to merge a PR with a deployment strategy called rsync_direct or some better name you can come up with. Please add tests and docs

ricardclau commented 4 years ago

Fixed with #335