Closed Pegasuz closed 5 years ago
Hi @Pegasuz, thanks for your contribution. It would be great if you can add some tests. Do you think it's feasible?
After reviewing the code more in detail, I think the method should be just unarchive (ansistrano goes to find a file in the existing server and unarchives it). How the file is put in the server is something easy to handle as a hook task. What do you think? Also I will like to hear from @ricardclau 😄
What do you mean with a hook task?
You could also unpack a file after copying it from the local machine, using the default remote_src: no
option of the unarchive
Ansible module. What do you think?
Hi @membrive. You can use the "ansistrano_before_update_code_tasks_file" hook to upload the file to your server. Then a new "unarchive" method to deploy from a zip file in the same server is what should be created.
Hi @Pegasuz and @membrive!
I see two options here:
(from http://docs.ansible.com/ansible/latest/get_url_module.html)
Thanks for your time contributing and commenting 👍
Hi @carlosbuenosvinos, thanks for your answer.
I like option 1 over 2, since it can be used without needing an additional file for the hook.
I will try it this week. Thank you!
Great @membrive! Let me know how it goes!
Hi @membrive and @Pegasuz! Any update about the proposed approach? Can be close this PR? Thanks!
@carlosbuenosvinos sorry, I haven't had time to try it, but I'll do it as soon as possible.
What's going on with this PR? I use CircleCI and doing rsync will just take tons of time without archiving before. Thanks!
Closing as this can be achieved with a pre hook and using existing strategies such as donwload_unarchive or copy_unarchive
This adds an option to deploy a pre-build package of your code to the remote servers using rsync, unarchive it, and use it to deploy the application.
Option name:
ansistrano_deploy_via: "rsync_unarchive"
To specify the deploy package:
ansistrano_deploy_from: "{{ playbook_dir }}/../deploy_package.tar.gz"
This option is needed because we use a CI tool to generate all dependencies for our project, package everything and deploy this package.
This makes it very useful to re-use the deploy packages.