Hi Jose,

It's not clear from your post whether you're loading the `rails/all` (or
maybe just `rails/migrations`, but I'll answer under the assumption that
you're not, and that if you are, whatever they do to your database servers
(run migrations) is not a problem.

Assuming that you can convert your script to Ruby, or run it still via
Bash, probably Ruby would be more robust, anyway, http://www.shellcheck.net/
is a decent tool to run your Bash script through, if sticking with Bash.
Both will work.

#
https://github.com/capistrano/sshkit/blob/master/EXAMPLES.md#upload-a-file-from-disk

task :fixitup do
on roles(:db) do |host|
 upload! './my-local-script.rb', './my-script.rb'
 execute :ruby, "./my-script.rb"
end
end

# http://capistranorb.com/documentation/getting-started/before-after/
# http://capistranorb.com/documentation/getting-started/flow/
after "deploy:starting", "fixitup"


Lee Hambley
http://lee.hambley.name/
+49 (0) 170 298 5667

On 11 September 2015 at 18:54, José Sá <[email protected]> wrote:

> Hi all,
>
>
> i'm trying to create a custom deploy script but having some trouble in
> some aspects:
>
> 1. I want to deploy the servers with role DB before starting to run other
> servers. So:
>  Start deploy
>  - Run deploy sequence in the the servers with the specific role,
>  - When finished start the other servers
>
> This scenario doesn't seem to be covered natively.
>
> 2. I need to perform some complex file manipulation on the remote server
> as part of the deployment process.
> Currently I have a bash script that does this but I would prefer to have
> the whole deployment script inside Capistrano rules instead of calling
> external scripts.
>
> I can convert it into ruby (is mostly reading a bunch of files and use sed
> to generate a new one), so I would like to know the best practise here.
>
> Call invoke with a multiline script?
>
>
> --
> 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 [email protected].
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/capistrano/a3272533-6f1f-4386-9aa2-f858bf376bec%40googlegroups.com
> <https://groups.google.com/d/msgid/capistrano/a3272533-6f1f-4386-9aa2-f858bf376bec%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/capistrano/CAN_%2BVLXe8w4MTjKYYVbkwaF-Us2qu8ZcJrmOhN7T2-1WG3i_SA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to