Here is a barebones guide to get people started

 

Notice the note.does anyone know how to restart the webrick  server ? 


 

Even a quick and dirty command line?

 

 

Anyways hope this help some of you 


--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

3 servers used in a basic capistrano application, these actually can be all on 
one machine , but to avoid confusion lets say 3


dev - inital setup and development machine, you'll be running all cap commands 
from here and here only
deploy - where the live app will be going, final resting place of the actual 
cap deployed application
subversion, version control machine, where your application is stored for both 
development and deployment


first of all make sure you have these softwares installed

we will not be worrying about the database config 
db setup is unessecary to learning basic deployment

we also will not be worrying about apache mongrel pound or any other :web server
as it also just adds points of confusion and everyone has a different set up

we'll just set it to run the "script/server -d" to show this works
***is there a way to restart the script/server command?***

so first lets get to checking requirements for this
well be using cap so we'll need to install these binaries:
ruby 1.8.4
ruby gems
ruby termios (excluding windows)
subversion 

then we'll need to install all the nessecary gems:

dev>gem install --include-dependencies rake rails termios capistrano

ok if nothing goes wrong we are ready to continue on with the dev box set up


first we make a bare bones rails app
we are gonna call this deploy , cuz thats what we are working on

dev>rails deploy

then we apply cap to the project

dev>cd deploy
dev>cap -A /path/to/dev/deploy/  deploy

then we need to set up the config/deploy.rb with proper defaults for our 
particular deploy server machine:
notice the task 

==<app>/config/deploy.rb==
set :application, "deploy"
set :repository, "svn://subversion/#{application}/trunk"
set :svn_username, "svn"
set :svn_password, Proc.new {Capistrano::CLI::password_prompt('SVN Password:')}

role :web, "deploy"
role :app, "deploy"
role :db,  "deploy", :primary => true
set :deploy_to, "/path/to/deploy/deploy" # defaults to "/u/apps/#{application}"
set :user, "deploy"            # defaults to the currently logged in user



# =============================================================================
# TASKS
# =============================================================================

desc "Restart webbrick"
task :restart, :roles => :app do
run "cd #{deploy_to}/current; script/server -d"
end


<<file continues>>
==<app>/config/deploy.rb==



then we need to import our set up into the subversion repository and check it 
back out:
 svn import -m "import deploy test" . svn://subversion/deploy/trunk
 cd ../
 mv deploy/ deploy.start
 svn co svn://subversion/deploy/trunk deploy


only thing left to do is deploy the app:
 cd deploy
 cap deploy



now some things can go wrong at this stage:
if your deploy server is not posix shell youll need to set this
deploy>chsh -s bash
should do it

if you are having problems with ssh try something simple to test it
dev>  ssh deploy ls









Reply via email to