Creating a custom capistrano / rails deployment

44 views
Skip to first unread message

Vell

unread,
Mar 19, 2014, 10:24:33 AM3/19/14
to capis...@googlegroups.com
Hello all,

I am creating my first capistrano-rails deployment script and would like a little advice. The goal of my scrip tis to use 1 script to deploy any app that I want. So of course I will pass in the name and have all the repository info in the code. Right now to get started, I only have one question:

How can I generate the capistrano files so that I can utilize the code already generated and not have to rewrite anything that I don’t need to? I know I can put information about the repository and it already has code for deploying and rolling back. I just need to know how I can generate that template so that I have a starting point.

Also any suggestions or rules of thumb for this kind of thing are greatly appreciated.

Thanks,

Lee Hambley

unread,
Mar 19, 2014, 10:40:28 AM3/19/14
to capistrano

--
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/0EDE511E-04B5-49D0-AD19-BD437E60A5EA%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Vell

unread,
Mar 19, 2014, 11:50:26 AM3/19/14
to capis...@googlegroups.com
Hi Lee,

I don’t have an application yet. So are you telling me that I should generate a vanilla app and run this then just pull the files from there?

I guess that makes sense.

Lee Hambley

unread,
Mar 19, 2014, 11:51:55 AM3/19/14
to capistrano
Capistrano is used to put the app (you haven't built yet) into production, you might be a bit early for looking at deployment.

Vell

unread,
Mar 19, 2014, 12:02:21 PM3/19/14
to capis...@googlegroups.com
I have apps that I want to deploy. What I don’t want to do is have a separate cap deploy process for each app. I want to unify this into 1 deploy script that I can use to deploy any app that I wish. Basically I want to keep all the railsy stuff but decouple it from the app so that I can use it with any app in my repository.

1 script for many apps.

My initial question was about generating all the cap install code without having an application so that I can start modifying it and testing it with apps I currently have in my repository.

The goal is to be able to type deploy.rb <some_app> and utilize capistrano’s code to do what it does best.

Vell

unread,
Mar 19, 2014, 12:37:05 PM3/19/14
to capis...@googlegroups.com

Well thats weird. Running `cap install` in a directory (non rails app) creates the necessary files. I had run that command before and it complained about not finding a Gemfile. 

Lee Hambley

unread,
Mar 19, 2014, 1:37:26 PM3/19/14
to capistrano

Sorry, that won't work well you're on your own!

Sent from my Nexus 4.

Vell

unread,
Mar 19, 2014, 1:38:52 PM3/19/14
to capis...@googlegroups.com
OK then. when its done. I will send a url to my findings for anyone that cares to know.

Jonathan Rochkind

unread,
Mar 19, 2014, 2:29:54 PM3/19/14
to capis...@googlegroups.com
Just have a stub Capfile in each app, but the Capfile just pulls in code
from a shared file with the actual shared logic, perhaps getting it from
a (local, private) ruby gem. Perhaps using ruby 'load' to pull in the
shared logic. A Capfile is just ruby, you can do anything in it you can
do with ruby.

On 3/19/14 1:38 PM, Vell wrote:
> OK then. when its done. I will send a url to my findings for anyone that
> cares to know.
>
> On Mar 19, 2014, at 1:37 PM, Lee Hambley <lee.h...@gmail.com
> <mailto:lee.h...@gmail.com>> wrote:
>
>> Sorry, that won't work well you're on your own!
>>
>> Sent from my Nexus 4.
>>
>> On 19 Mar 2014 17:02, "Vell" <lovell....@gmail.com
>> <mailto:lovell....@gmail.com>> wrote:
>>
>> I have apps that I want to deploy. What I don’t want to do is have
>> a separate cap deploy process for each app. I want to unify this
>> into 1 deploy script that I can use to deploy any app that I wish.
>> Basically I want to keep all the railsy stuff but decouple it from
>> the app so that I can use it with any app in my repository.
>>
>> 1 script for many apps.
>>
>> My initial question was about generating all the cap install code
>> without having an application so that I can start modifying it and
>> testing it with apps I currently have in my repository.
>>
>> The goal is to be able to type deploy.rb <some_app> and utilize
>> capistrano’s code to do what it does best.
>>
>> On Mar 19, 2014, at 11:51 AM, Lee Hambley <lee.h...@gmail.com
>> <mailto:lee.h...@gmail.com>> wrote:
>>
>>> Capistrano is used to put the app (you haven't built yet) into
>>> production, you might be a bit early for looking at deployment.
>>>
>>> Lee Hambley
>>> --
>>> http://lee.hambley.name/
>>> +49 (0) 170 298 5667 <tel:%2B49%20%280%29%20170%20298%205667>
>>>
>>>
>>> On 19 March 2014 16:50, Vell <lovell....@gmail.com
>>> <mailto:lovell....@gmail.com>> wrote:
>>>
>>> Hi Lee,
>>>
>>> I don’t have an application yet. So are you telling me that I
>>> should generate a vanilla app and run this then just pull the
>>> files from there?
>>>
>>> I guess that makes sense.
>>>
>>> On Mar 19, 2014, at 10:40 AM, Lee Hambley
>>> <lee.h...@gmail.com <mailto:lee.h...@gmail.com>> wrote:
>>>
>>>> cap
>>>> installhttp://capistranorb.com/documentation/getting-started/preparing-your-application
>>>>
>>>> Lee Hambley
>>>> --
>>>> http://lee.hambley.name/
>>>> +49 (0) 170 298 5667 <tel:%2B49%20%280%29%20170%20298%205667>
>>>>
>>>>
>>>> On 19 March 2014 15:24, Vell <lovell....@gmail.com
>>>> <mailto:lovell....@gmail.com>> wrote:
>>>>
>>>> Hello all,
>>>>
>>>> I am creating my first capistrano-rails deployment
>>>> script and would like a little advice. The goal of my
>>>> scrip tis to use 1 script to deploy any app that I want.
>>>> So of course I will pass in the name and have all the
>>>> repository info in the code. Right now to get started, I
>>>> only have one question:
>>>>
>>>> How can I generate the capistrano files so that I can
>>>> utilize the code already generated and not have to
>>>> rewrite anything that I don't need to? I know I can put
>>>> information about the repository and it already has code
>>>> for deploying and rolling back. I just need to know how
>>>> I can generate that template so that I have a starting
>>>> point.
>>>>
>>>> Also any suggestions or rules of thumb for this kind of
>>>> thing are greatly appreciated.
>>>>
>>>> Thanks,
>>>>
>>>> --
>>>> 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
>>>> <mailto:capistrano%2Bunsu...@googlegroups.com>.
>>>> To view this discussion on the web, visit
>>>> https://groups.google.com/d/msgid/capistrano/0EDE511E-04B5-49D0-AD19-BD437E60A5EA%40gmail.com.
>>>> 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
>>>> capistrano+...@googlegroups.com
>>>> <mailto:capistrano+...@googlegroups.com>.
>>>> To view this discussion on the web, visit
>>>> https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUT%3DdmWu6Gs0yeb-ffFb2cE3seV%3DYb_%2BU3O5dwPJmO_7A%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUT%3DdmWu6Gs0yeb-ffFb2cE3seV%3DYb_%2BU3O5dwPJmO_7A%40mail.gmail.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 capistrano+...@googlegroups.com
>>> <mailto:capistrano+...@googlegroups.com>.
>>> To view this discussion on the web, visit
>>> https://groups.google.com/d/msgid/capistrano/B316DBBC-1931-4B42-9949-13CFAC0D3E3C%40gmail.com
>>> <https://groups.google.com/d/msgid/capistrano/B316DBBC-1931-4B42-9949-13CFAC0D3E3C%40gmail.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 capistrano+...@googlegroups.com
>>> <mailto:capistrano+...@googlegroups.com>.
>>> To view this discussion on the web, visit
>>> https://groups.google.com/d/msgid/capistrano/CAN_%2BVLVKN%2BzQxbczDE7LAXx00tAX%3DcSoZG%3D6HD07tBVL1%2BzYYA%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/capistrano/CAN_%2BVLVKN%2BzQxbczDE7LAXx00tAX%3DcSoZG%3D6HD07tBVL1%2BzYYA%40mail.gmail.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 capistrano+...@googlegroups.com
>> <mailto:capistrano+...@googlegroups.com>.
>> To view this discussion on the web, visit
>> https://groups.google.com/d/msgid/capistrano/E561A11D-FE96-4C15-B1AD-8EB01B312DE6%40gmail.com
>> <https://groups.google.com/d/msgid/capistrano/E561A11D-FE96-4C15-B1AD-8EB01B312DE6%40gmail.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 capistrano+...@googlegroups.com
>> <mailto:capistrano+...@googlegroups.com>.
>> To view this discussion on the web, visit
>> https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUFPgh5N-0C-6-OHBK06wB-UV0m%3DbbsUgHs51yr1kBVuA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/capistrano/CAN_%2BVLUFPgh5N-0C-6-OHBK06wB-UV0m%3DbbsUgHs51yr1kBVuA%40mail.gmail.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 capistrano+...@googlegroups.com
> <mailto:capistrano+...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/capistrano/E4F75991-7CD0-43A5-9668-C43D72F6AF65%40gmail.com
> <https://groups.google.com/d/msgid/capistrano/E4F75991-7CD0-43A5-9668-C43D72F6AF65%40gmail.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages