Basics of Capistrano

I'm searching the net but about Capistrano, but can't get a complete understanding. Could someone please give me some small hints :slight_smile:

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?

First link should be fine.

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?

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.

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? :slight_smile:

A good question. :slight_smile:

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.

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 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@marnen.org

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.

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,

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. :slight_smile:

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 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. :slight_smile:

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. :slight_smile:

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?

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...

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)?

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 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.

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,