I''m searching the net but about Capistrano, but can''t get a complete understanding. Could someone please give me some small hints :) I have local developer environment, using git. The remote server also has git and I have the app in root. Today I use ftp. What should I do when I just want to send the files that are different, letting my local app decide that, and how does the deploy.rb look like? -- Posted via http://www.ruby-forum.com/.
On Jul 15, 12:14 am, Pål Bergström <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m searching the net but about Capistrano, but can''t get a complete > understanding. Could someone please give me some small hints :) > > I have local developer environment, using git. The remote server also > has git and I have the app in root. Today I use ftp. What should I do > when I just want to send the files that are different, letting my local > app decide that, and how does the deploy.rb look like?http://www.google.com/#hl=en&q=capistrano+tutorial First link should be fine.
Eric wrote:> On Jul 15, 12:14�am, P�l Bergstr�m <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> I''m searching the net but about Capistrano, but can''t get a complete >> understanding. Could someone please give me some small hints :) >> >> I have local developer environment, using git. The remote server also >> has git and I have the app in root. Today I use ftp. What should I do >> when I just want to send the files that are different, letting my local >> app decide that, and how does the deploy.rb look like? > > http://www.google.com/#hl=en&q=capistrano+tutorial > > First link should be fine.Great. I use site5. But what I don''t understand; is the git repository the same as the app directory (the article is about svn)? This would help me a lot to understand. -- Posted via http://www.ruby-forum.com/.
This is a great tutorial. http://www.softiesonrails.com/2007/4/5/the-absolute-moron-s-guide-to-capistrano But one thing I need to understand. What about git? Does that has anything to with it? It states that nothing has to be done on the server side, so I guess can skip git there and use it only locally. Is that correct? -- Posted via http://www.ruby-forum.com/.
And what happens with the db? Do I need to specify that or does it use the values from database.yml? Can I skip the db if I want? -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote: [...]> But one thing I need to understand. What about git? Does that has > anything to with it?Yes, absolutely. The way most people use Capistrano, the server checks out the code from the Git repository.> It states that nothing has to be done on the server > side, so I guess can skip git there and use it only locally. Is that > correct?I think there may be a way to set Capistrano to do that, but it''s probably not a great idea. Nothing needs to be done on the server side *in the sense that you don''t install Cap on the server*, but the server *does* need the tools that Cap is going to try to call. Basically, Cap logs into the server and runs a particular sequence of commands on the server. Thus, if Cap runs "git pull" on the server, the server will need Git installed for the command to have any effect. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> Basically, Cap logs into the server and runs a particular sequence of > commands on the server. Thus, if Cap runs "git pull" on the server, the > server will need Git installed for the command to have any effect. >I see. Git is installed on the server. Should I make the app directory on the server a git repository too? Or will Capistrano fix that. So probably a stupid question, but is the app directory on the server the same as the git repository? -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote:> Marnen Laibow-Koser wrote: > >> Basically, Cap logs into the server and runs a particular sequence of >> commands on the server. Thus, if Cap runs "git pull" on the server, the >> server will need Git installed for the command to have any effect. >> > > I see. Git is installed on the server.Great!> > Should I make the app directory on the server a git repository too? Or > will Capistrano fix that.Capistrano will take care of checking out the app from the repository and doing what it needs to do. You don''t need to worry about it.> So probably a stupid question, but is the app > directory on the server the same as the git repository?Generally not. Capistrano will check out a working cooy to run on the server. You probably could run the app right from the repository, but I see no advantage and many potential problems in doing so. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> Pål Bergström wrote:> Generally not. Capistrano will check out a working cooy to run on the > server. You probably could run the app right from the repository, but I > see no advantage and many potential problems in doing so.And now I''m lost. What''s the repository for on the server? And how is that connected to the particular app root (I''m adding several domains and apps under one main domain)? When I use git locally, it''s the same. I think. I only use git for version control and using the branch command for testing new things. The important thing for me is the local version. The server is just to be a mirror of that. -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote:> Marnen Laibow-Koser wrote: >> Pål Bergström wrote: > >> Generally not. Capistrano will check out a working cooy to run on the >> server. You probably could run the app right from the repository, but I >> see no advantage and many potential problems in doing so. > > And now I''m lost. What''s the repository for on the server?The repository is a central place to store your Git data for your project. This is a Git concept (actually, it''s a general version control concept).> And how is > that connected to the particular app root (I''m adding several domains > and apps under one main domain)?It''s not connected in any particular way. The repository has to do only with source control, and does not know anything directly about deployment.> > When I use git locally, it''s the same. I think. I only use git for > version control and using the branch command for testing new things. The > important thing for me is the local version.That''s right. And likewise on the server: Capistrano will check out a local copy from the repository to be the actual running app instance.> The server is just to be a > mirror of that.That''s a *very* simplistic way of looking at it. I''d say more that your local copy is a mirror of the server. Really, what''s the problem here? There is a repository. From it, you check out copies for development, and Capistrano checks out copies (in the same way) for deployment. How much simpler can it get? :) Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> > Really, what''s the problem here? There is a repository. From it, you > check out copies for development, and Capistrano checks out copies (in > the same way) for deployment. How much simpler can it get? :) >A good question. :-) I guess I have problem understanding the basic principle. For example, when I make a pointer at the server admin, where do I make that? There must be a root somewhere. -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote: [...]> For example, when I make a pointer at the server admin, where do I make > that? There must be a root somewhere.Huh? What are you talking about here? I don''t think I understand what you''re asking, and I certainly don''t understand how it relates to the issue at hand. Rephrase? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> Pål Bergström wrote: > [...] >> For example, when I make a pointer at the server admin, where do I make >> that? There must be a root somewhere. > > Huh? What are you talking about here? I don''t think I understand what > you''re asking, and I certainly don''t understand how it relates to the > issue at hand. Rephrase? > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.orgI can host several apps and domains under one main account. As they use the same server, same dns, you have to point each domain to the app root it belongs to. -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote: [...]> I can host several apps and domains under one main account. As they use > the same server, same dns, you have to point each domain to the app root > it belongs to.Right. But setting up vhost root directory mappings is outside of the scope of a typical Cap setup -- for one thing, you''ll only have to do it once per vhost, not every time you update the codebase. So how is this related to your Capistrano questions? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Btw, I''m not interested of version control on the server side. I use git locally, but not extensively as I don''t need it that much, and want to use Capistrano to deploy the app. Can this be done? -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote:> Btw, I''m not interested of version control on the server side.Maybe, but pulling from Git is the simplest way for the server to get the code.> I use git > locally, but not extensively as I don''t need it that much,What do you mean, you "don''t need it that much"? Any development operation -- even a solo hobby developer -- benefits from comprehensive version control.> and want to > use Capistrano to deploy the app. Can this be done?Yes. And I''ve been explaining how. Try it! Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> What do you mean, you "don''t need it that much"? Any development > operation -- even a solo hobby developer -- benefits from comprehensive > version control.I''ve manage without it for a very long time. And I''m not a hobby developer. :-) -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote: [...]> I''ve manage without it for a very long time.Then you are making life hard for yourself. Trust me on this. (I used to work without version control too, a long time ago. I''d never ever do that again.)> And I''m not a hobby > developer. :-)I didn''t say you were. Getting back to the topic, do you understand now how to get Cap deployment working? It''s really not terribly difficult if you trust Capistrano to do the right thing in most cases. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> Pål Bergström wrote: > [...] >> I''ve manage without it for a very long time. > > Then you are making life hard for yourself. Trust me on this. >Not really. And I have a long experience. What I like about git is branching. But for actual version control I can manage without it. I''ve used git for a while now and I''ve never needed to use it for going back in code. Trust me. :-)> Getting back to the topic, do you understand now how to get Cap > deployment working? It''s really not terribly difficult if you trust > Capistrano to do the right thing in most cases.Not quite. I don''t think is that clear. And maybe that''s why a few people have had a hard time getting into it. Often developers, or programmers that is, have a hard time explaining things. And sometimes we users are just thick headed. :-) So back to my question, what if I, as I would like that way, have zero and nada interest of having version control on the server side? -- Posted via http://www.ruby-forum.com/.
You can still use Capistrano to push the code from your local directory where you are working(Like your rails root). But the main great reason to use Capistrano is to get version deployments so that you can roll-back if something happens to "fail" in production or pushing to a staging environment with one tag/branch from cvs/ subversion/git then pushing the same code to production when you know this code is good. You can just put your own tasks in the cap scripts but this is going to be a advanced setup. I have done something similar for a none Rails project but it would be a custom setup for sure.... I would say that your life with Capistrano would just be SOO much easier if you use something like git/svn... On Jul 15, 1:46 pm, Pål Bergström <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Marnen Laibow-Koser wrote: > > Pål Bergström wrote: > > [...] > >> I''ve manage without it for a very long time. > > > Then you are making life hard for yourself. Trust me on this. > > Not really. And I have a long experience. What I like about git is > branching. But for actual version control I can manage without it. I''ve > used git for a while now and I''ve never needed to use it for going back > in code. Trust me. :-) > > > Getting back to the topic, do you understand now how to get Cap > > deployment working? It''s really not terribly difficult if you trust > > Capistrano to do the right thing in most cases. > > Not quite. I don''t think is that clear. And maybe that''s why a few > people have had a hard time getting into it. Often developers, or > programmers that is, have a hard time explaining things. > > And sometimes we users are just thick headed. :-) > > So back to my question, what if I, as I would like that way, have zero > and nada interest of having version control on the server side? > -- > Posted viahttp://www.ruby-forum.com/.
Pål Bergström wrote:> What I like about git is > branching.Likewise.> But for actual version control I can manage without it. I''ve > used git for a while now and I''ve never needed to use it for going back > in code. Trust me. :-)You''ve never had a branch that you wanted to back out of? You''ve never wanted to not deploy the bleeding-edge version of your codebase until it stabilizes?> >> Getting back to the topic, do you understand now how to get Cap >> deployment working? It''s really not terribly difficult if you trust >> Capistrano to do the right thing in most cases. > > Not quite. I don''t think is that clear.What don''t you understand? [...]> And sometimes we users are just thick headed. :-)Sure sounds like it. Give it a try and let me know if you have any actual problems.> > So back to my question, what if I, as I would like that way, have zero > and nada interest of having version control on the server side?Then you will not get much sympathy from me, nor from many others on this list, as you are asking for help in implementing a Certified Bad Idea [TM]. It can be done, but I do not recommend it. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
> I would say that your life with Capistrano would just be SOO much > easier if you use something like git/svn... >But I don''t understand how. Arrgh. Should I setup a repository on the server myself? What about my apps, what would be the path for pointers? Sorry, but I don''t think you see the issue here. How does it work on the server side? I can''t find any tutorials that talks about that. Like the otherwise very good "The Absolute Moron''s Guide to Capistrano" (that''s me). It kind of leaves out big chunk. It states "set :repository, "http://somesvnrepository/trunk"" What about that somesvnrepository (git in my case)? -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote:> >> I would say that your life with Capistrano would just be SOO much >> easier if you use something like git/svn... >> > > But I don''t understand how. Arrgh. Should I setup a repository on the > server myself?Yes. Gitosis is a nice way to set up a Git server, or you can use a hosted service such as Github, Unfuddle, or Gitorious.> What about my apps, what would be the path for pointers?Whatever you like.> > Sorry, but I don''t think you see the issue here. How does it work on the > server side? I can''t find any tutorials that talks about that.I think it''s assumed in Cap tutorials that you already know how your version control server works.> Like the > otherwise very good "The Absolute Moron''s Guide to Capistrano" (that''s > me). It kind of leaves out big chunk. It states "set :repository, > "http://somesvnrepository/trunk"" What about that somesvnrepository (git > in my case)?What about it? The tutorial assumes you already have your source code repository set up. (I think most developers these days do that as one of the very first steps in starting a new project -- I know I do.) In any case, Cap is usually set up to communicate with an already established repository, not to set one up itself. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> You''ve never had a branch that you wanted to back out of? You''ve never > wanted to not deploy the bleeding-edge version of your codebase until it > stabilizes?No. But I might if I get into git more. But with my way of working I know I can manage without it.> What don''t you understand?The server side.> Then you will not get much sympathy from me, nor from many others on > this list, as you are asking for help in implementing a Certified Bad > Idea [TM]. It can be done, but I do not recommend it. >I doubt that I''m alone on this. What really matters is getting a good well designed and design oriented site up using solid web standards. That comes first. -- Posted via http://www.ruby-forum.com/.
Marnen Laibow-Koser wrote:> Pål Bergström wrote:> >> What about my apps, what would be the path for pointers? > > Whatever you like.That will not work. What are you talking about?> I think most developers these days do that as one of the very first steps in starting a new projectFar from it. Are you a web developer? -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote:> Marnen Laibow-Koser wrote: >> Pål Bergström wrote: > > >> >>> What about my apps, what would be the path for pointers? >> >> Whatever you like. > > That will not work. What are you talking about?Well, you can set your app''s directory to anything you want. What about that won''t work?> >> I think most developers these days do that as one of the very first steps in starting a new project > > Far from it. Are you a web developer?Yes -- 10 years'' worth of one. Are you? Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
> > Yes -- 10 years'' worth of one. Are you?Yes. Longer than that. But coming from a design perspective, which should be the focus in any serious web project. -- Posted via http://www.ruby-forum.com/.
Pål Bergström wrote:> >> >> Yes -- 10 years'' worth of one. Are you? > > Yes. Longer than that. But coming from a design perspective, which > should be the focus in any serious web project.I agree with you (I sort of started there too), but one can''t neglect good coding practice either. Making the two work together harmoniously is what makes good Web development so challenging. But we''re losing the topic here... Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.