capistrano

Deployment with Capistrano

Hi guys, I am trying to get into PHP app deployment with Capistrano. I have two config files that I need to be "edited" depending on where I deploy it. It's basic stuff like database name and root url (Codeigniter). Can I make Capistrano edit specified automatically? Let's say I want to edit the following in the file /system/config/edit....

deploying with capistrano with remote git repo but without git running on production server

I have a remote git repository setup for centralized development within my team. However, the production server that we deploy our applications currently does not have git running on it. We want to use capistrano to deploy our applications how can we set up our deploy recipes to 'pull' from the remote git repositories when deploying? In...

Reading the first line of a file in Ruby

I want to read only the first line of a file using Ruby in the fastest, simplest, most idiomatic way possible. What's the best approach? (Specifically: I want to read the git commit UUID out of the REVISION file in my latest Capistrano-deployed Rails directory, and then output that to my tag. This will let me see at an http-glance what...

Why is Capistrano not checking out the latest version of my code from SVN?

I'm using Capistrano and Rails 2.3.4. I've already done a deploy:cold to the remote server. Now on my local box I changed a layout file and committed it to the repository (I am using Netbeans 6 as my IDE). I type cap deploy and Capistrano runs through it's commands and tells me that it's checked out and deployed the most recent versio...

Deploying with Capistrano & Subversion. Working copy locked

I'm deploying to a Debian server with Capistrano which fails due to locked a working copy. I narrowed it down to this: svn checkout http://myrepo.net/mysite/tags/1.0 /var/www/mysite/releases/1234 So if I run: cap invoke COMMAND='svn checkout http://myrepo.net/mysite/tags/1.0 /var/www/mysite/releases/1234' I get an error: svn: Workin...

Using capistrano to deploy from different git branches

I am using capistrano to deploy a RoR application. The codebase is in a git repository, and branching is widely used in development. Capistrano uses deploy.rb file for it's settings, one of them being the branch to deploy from. My problem is this: let's say I create a new branch A from master. The deploy file will reference master bran...

How do you add some steps to a capistrano task?

I'd like to stop some processes before running the deploy:migrate task. I know that I can redefine the deploy:migrate task by copying the existing code and adding the stop/start steps at the beginning and end of the task. I'm wondering if there is a way to avoid copying the code from the default deploy:migrate task in my version of t...

Is there good deployment and administration for Java environments?

We already have a good build server in Hudson but we want something that would let us startup and shutdown servers, push out new deployments of software (which is much more involved than just a single WAR or EAR going somewhere, there is copying, extracting, renaming, etc.), and various other tasks we would like to automate. I've looked...

Deploying rails application to multiple environments

I am getting ready to deploy to a true production environment. When I say true I mean that my current production environment will now be staging because there is other crap on the server and I am creating a new larger slice for what will actually be my production machine. The capistrano-ext gem has made separating the deploy recipes qu...

Capistrano :shell example

Hello experts. I'm currently using Capistrano to deploy my web application which works like a charm. In my new project I must execute a command from sudo /bin/bash shell. Is it possible for Capistrano to login to the machine as user X, run sudo /bin/bash, enter the password and then execute a command in the sudo shell? If yes, could yo...

capistrano not restarting, stopping but update is working

I recently changed machines, and had a few rough spots updating Rails. The server itself stayed as it was. Everything seemed to be fine, but not capistrano. When I make changes and update SVN, running cap deploy the correct new version of the repository is placed on the server. The logging in the terminal running capistrano shows not...

Capistrano Deploy Wipes Database?

I've managed to deploy my app to production using Capistrano, but I don't understand how to deal with my database. I'm using subversion and passenger. When I run cap deploy, the new deployment starts everything fresh. It wipes out the data that was added to the database. Obviously, there must be a solution, but I'm very surprised not...

Creating crontab via Capistrano instead of using crontab -e

I would like to include cron tasks in my Capistrano deployment files instead of using the following command to manually edit the crontab file: crontab -e [username] Is there a script I could use within the Capistrano run command to set the contents of the crontab? ...

Capistrano & Git: Needed a single revision

Capistrano and Git worked properly till I moved my site to another server. My first attempt to deploy went wrong because of an SSH-known-hosts related problem. Even if I managed to solve this problem, another one raised and I can't deploy any more: * executing `deploy' * executing `deploy:update' ** transaction: start * executi...

How can you check to see if a file exists (on the remote server) in Capistrano?

Like many others I've seen in the Googleverse, I fell victim to the File.exists? trap, which of course checks your local file system, not the server you are deploying to. I found one result that used a shell hack like if [[ -d #{shared_path}/images ]]; then ... but that doesn't sit well with me, unless it were wrapped nicely in a Ru...

Using Capistrano to deploy a Rails application to multiple web servers

I'm currently setting up a new production environment for a Rails application which includes multiple, load-balanced application servers (currently only two, but this will increase over time). I'd like to handle deployment of the app to all these servers in a single command using Capistrano (which I already use for my existing, single...

How can I combine these git commands?

I do the following string of commands for git and my fingers are getting tired of typing them. :) git add . git commit -m 'Some message' git push cap deploy How can I combine those (including adding a message) into a single command, like "git booyah" or something? ...

Passenger, Nginx, and Capistrano - Passenger not launching Rails app at all

Essentially, my route is working perfectly, Passenger seems to be loading - all is hunky-dory. Except that nothing Railsy happens. Here's my Nginx log from starting the server to the first request (ignore the different domain/route - it's because I haven't moved the new domain over yet, and it's returning a 403 error because there's no i...

Starting delayed_job at startup

I'm using delayed_job with capistrano and would like a way to start delayed_job on startup of the web application using the 'script/delayed_job start'. This way capistrano can restart it on deploy. If the server gets rebooted then my delayed_jobs should start up with the project. How can I do this? Should I be looking at doing this in...

Connection Failed when Deploying with Capistrano in Snow Leopard

I'm trying to deploy a PHP project using Capistrano. When I try to do a cap deploy, I get an error: wes:/var/www/nipponpulse [svn:] → cap deploy * executing `deploy' ** transaction: start * executing `deploy:update_code' executing locally: "svn info https://newcitymedia.svn.beanstalkapp.com/nippon_pulse/expressionengine -rHEAD...