On Fri, Mar 18, 2011 at 3:09 PM, sal streets <li...@ruby-forum.com> wrote:

> Radhames Brito wrote in post #988201:
> > It is very important that you locate the deploy.rb file it should be in
> > the
> > config directory, is not directly related to your question but it is
> > important that you know how the app was deployed
>
> Hi Radhmes,
>
> there is no deploy.rd in config but we do have this info from the
> initial developers
>
>
> "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

1)  the app that is sometime directly in the deploy_to path and not the one
inside the current directory
2)  One of the releases that is not the current
3)  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

1) Find out where is the repository
2) do  git clone path_to_repository


3) check for the database.yml file since it is posible that it was not
version managent and is missing
4) if is not there make one and add the proper servers
5) bundle install              <====== to install the gems
6) git checkout -b updating_static       <========to create a branch and not
mess up the original code
7) edit at will
8) git checkout master
9) 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


11) 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.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to