Multiple roles/apps from the same Capfile

56 views
Skip to first unread message

David Resnick

unread,
Dec 9, 2015, 3:21:04 PM12/9/15
to Capistrano
I'm new to Capistrano and am trying to figure something out.

I have a codebase that until now has been a Ruby on Rails application (using Ruby 2.1.2), using Capistrano to deploy.

Now I'd also like to run the codebase as a Ruby script based service (no Rails and not listening for HTTP requests). This version of the service will run using JRuby.

Both applications use the same Gemfile, with lot's of code in common between the 2 apps.

I'm trying to figure out how to expand the Capfile to support the additional deployment configuration. 

A direction I'm looking at is to deploy using a new role in the Capfile. This new role will have quite a few differences from the existing one, e.g. how it restarts the service, where the service is installed.

My questions are: does this approach make any sense? Can anyone point out a more complex Capfile that shows some part of what I've described?

In the meantime, I’m looking at adding the new role in a new namespace.

Thanks,
David

Versions:
  • Ruby
    • ruby 2.1.2 + jruby 9.0.4.0
  • Capistrano
    • 3.4.0

Lee Hambley

unread,
Dec 11, 2015, 12:08:45 PM12/11/15
to Capistrano
Hi David,

Still struggling?

--
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/7c534098-5080-4f02-9ef6-125fc2d498a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Resnick

unread,
Jan 3, 2016, 12:02:19 PM1/3/16
to Capistrano
Not really. Unfortunately, it took me a while to figure out that the values defined in a deploy.rb file are global and can't be changed on a per-role basis.

In the end, I gave up on changing those values (such as deploy_to) based on roles and worked around it. 

I find capistrano to be fairly inflexible and difficult to extend with the additional app I wanted to deploy from the same configuration.

Sorry I didn't reply until now, I didn't receive a notification about your question and didn't notice it until now.

- David
Reply all
Reply to author
Forward
0 new messages