-
sudo gem install capistrano-ext
-
cd yours_rails_directory
-
capify .
-
mkdir config/deploy
Now we will create two deployments staging and production and a new staging environment.
-
touch config/deploy/staging.rb
-
touch config/deploy/production.rb
-
touch config/environments/staging.rb
-
config/deploy.rb
-
config/deploy/production.rb
-
config/deploy/staging.rb
-
config/environments/staging.rb
: config/databases.yml
Now run the capistrano commands to set up the deployment.
-
cap staging deploy:setup
(this creates the correct directory tree) -
cap staging deploy:check
(this checks to make sure setup ran) -
cap staging deploy:update
(this updates the server with the app code) -
ssh your_user_name@your_deployment_server
(fill in the correct user and server here) -
cd your_deployment_directory/current
(again fill in the correct deploy to dir) -
RAILS_ENV=staging sudo rake gems:install
(this installs gems that need native compiling) -
RAILS_ENV=staging rake db:schema:load
(loads the database) -
RAILS_ENV=staging rake db:seed
(loads any seed data) -
script/console staging
(load the console for testing) -
app.get('/')
(test to see if this returns ‘200’) -
exit
(exit the console) -
exit
(exit ssh) -
cap staging deploy:restart
Hi there!
ReplyDeleteWe launched a RailsRumble project about a month ago called DeployButton, that's getting a fair number of active users deploying using Capistrano every day.
If you end up using it, please drop us a line and give us your feedback on new features that you'd like to see developed for it! :)
Thanks,
Ash
--
DeployButton.com makes continuous delivery easy with a single button.