On Fri, Mar 18, 2011 at 3:09 PM, sal streets [email protected]
wrote:
"ull Ruby on Rails stack such as Phusion Passenger + Apache (with Ruby
1.8.6).
In addition, you will need a MySQL server.
The current site is held in Version Control software called Git. We
deploy it using Capistrano. "
I see, if with was deployed with capistrano there is a deploy.rb
somewhere
this file is a script (also called a recipe) with lots of valuable
information. I will now explain what capistrano does and why you need to
undertand how your app was deployed.
Capistrano read the deploy.rb file and finds out the name of the web
server,
the repository server and the db server. all this info must be put in
the
deploy.rb file by the developer. Then you specify your versioning
system, in
your irb file there must be something like this
set :deploy_via, :remote_cache
set :scm, ‘git’
set :branch, ‘master’
set :scm_verbose, true
set :use_sudo, false
what capistrano does the first time you deploy your app is, it creates a
folder structure where it puts a release directory, in it is at least
the
last 5 versions of the app, next to it is a current directory, this
current
directory is a symbolink link to the latest realease in the releases
directory. You , the developer make Passenger point to the public
directory
of the current directory, that is , in your httpd file
there should be a host to app_path/current/public. It also creates a
shared folder where data that is common between releases i stored.
That is what happens the first time you are going to deploy with the
command
cap deploy:setup
after that for each deployment it does this :
1 Checkouts the head of the master branch from the specified repository
server via the specified version management system
2 Rebuild the symbolic link of the current directory so that it now
point to
the latest release in the releases directory.
3 Touches the file current/tmp/restart.txt , which causes passenger to
restart
As you can see is posible that you are editing
- the app that is sometime directly in the deploy_to path and not the
one
inside the current directory
- One of the releases that is not the current
- the wrong restart.txt
The best way to update your app is via capistrano, this are the steps
if you dont have access to the source code, if you do you can go to 3
-
Find out where is the repository
-
do git clone path_to_repository
-
check for the database.yml file since it is posible that it was not
version managent and is missing
-
if is not there make one and add the proper servers
-
bundle install <====== to install the gems
-
git checkout -b updating_static <========to create a branch and
not
mess up the original code
-
edit at will
-
git checkout master
-
git merge updating_static <======== to apply your changes to the
master
10 ) git push origin master <==== this should send the changes to the
repository
Here is where you start to use capistrano
- cap deploy <=== it may ask for password serveral times
,
each time it connect to one of the servers
you are done.
As you can see with capistrano everything takes one command, cap deploy,
everything above was so you can have a copy of the app in your
development
machine.
Capistranos has everything it need in the deploy.rb file is in the
repository pull it and checkit out, if you want to you can put it here
(
remove any passwords and ip) and we can tell you what is suppose to do.