Which hook to upload config files on?

24 views
Skip to first unread message

Chiel Kunkels

unread,
Jul 9, 2015, 4:34:56 PM7/9/15
to capis...@googlegroups.com
Hi all,

I am using the `set :linked_files` to set a file I want symlinked into every release, however the file that needs to be linked is uploaded in the course of the deployment.

However, when doing a cold deploy, it appears that the `linked_files` are being symlinked before the files are being uploaded.

So, I am wondering what the best time is to be uploading these files to the server? At the moment I am using the `after :'deploy:starting'` hook, but that doesn't seem to be early enough, however it feels to me like I can't do it before then either because the directory structure will not have been created.

Any suggestions are very welcome!

Cheers,
Chiel.

Chiel Kunkels

unread,
Jul 9, 2015, 4:51:31 PM7/9/15
to capis...@googlegroups.com
Alright, just been through the source code, and it appears that :after :'deploy:starting'` is too late since during `deploy:starting`, linked_files and linked_dirs are already checked. So, I'm now using the after :'deploy:check:directories'` hook, which was not clearly documented here: http://capistranorb.com/documentation/getting-started/flow/

Great success.

Lee Hambley

unread,
Jul 9, 2015, 5:49:24 PM7/9/15
to Capistrano
Glad you were able to get things working, the flow (as you have seen) does not document *every* hook, as the list is simply unreasonably long, if you feel the docs could be improved they are hosted at GH and we would be glad of any contribution you might make.

--
You received this message because you are subscribed to the Google Groups "Capistrano" group.
To unsubscribe from this group and stop receiving emails from it, send an email to capistrano+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/capistrano/db41e240-2738-4f64-a3b7-93ed7a939110%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Chiel Kunkels

unread,
Jul 10, 2015, 5:03:22 AM7/10/15
to capis...@googlegroups.com
Will definitely contribute when I find myself with some spare time on my hands, as I really like the project.

I understand it's an unreasonably long list, but that's what the source exists for of course. The only thing I'm wondering is whether or not it's logical for the symlinks to be created during the `check` stage, since I imagine uploading config files is a fairly common practise. That said though, I suppose that's what tools like ansible, chef and puppet are made for. A thin line separating these tools.

Cheers!
Chiel

Lee Hambley

unread,
Jul 11, 2015, 2:11:49 PM7/11/15
to Capistrano
Anything you can contribute, however small is welcome. You might also try `cap -p` which should work, as we inherit that from Rake, which shows the prerequisite tasks to run any given task:

http://devblog.avdi.org/2014/04/23/rake-part-3-rules/ has a little to say about that, but it might help you understand where all the wiring is coming from (caveat: not all plugins are written as prerequisite hooks, some simply "extend" tasks to run other tasks)
Reply all
Reply to author
Forward
0 new messages