user898699
user898699

Reputation:

Building and deploying from a remote server with Capistrano

I'm new to Capistrano and struggling a little to get started. A brief description of what I need to do:

So in principle it seems rather simple, but Capistrano seems opinionated and a bit magical. As a result I'm not sure how to accomplish all of this. It seems like it wants to check out my code and copy it to the remote machines, for example without building it first.

I think I need to ignore all of Capistrano's default smarts and just make it run some shell commands on the appropriate servers. In pseudo-code:

Am I even using the right tool for the job? It seems a lot like a round peg in a square hole.

Can someone explain to me what the contents of the Capistrano configuration files should be, and what cap commands I'd run to accomplish this?

BTW, I've searched around and looked at questions like deploying with capistrano with remote git repo but without git running on production server and From manual pull on server to Capistrano

Upvotes: 2

Views: 635

Answers (1)

The question is rather old, but you never know when someone steps onto it in need of information...

First and formost, consider that Capistrano might just not be the right tool for the job you want to do.

That said, it is not impossible to accomplish what you expect. While in projects that deploy large amount of files and modify them (like css/js minify, js builds etc.) I would avoid it, in your case, you can consider runing a "deployment repository" and configure it in capistrano as the source. Your process would look like this :

  • run the local build with whatever tools you need
  • upload resulting binary to a deployment repository
  • run capistrano that will connect to application servers, fetch fresh binary from repository, perform any server side tasks required and symlink to "current"

As a side effect you end up with full history of deployed binaries

Upvotes: 1

Related Questions