Talk:Deployment

CS290F Fall 2006 - UCSB Computer Science - Thorsten von Eicken

Jump to: navigation, search

Wei Zhang reports an error in deploy.rb:

  • There's a small bug in the deploy.rb sample, at line 41, should be "set :mongrel_prefix, "/usr/bin" # path for mongrel_rails executable", no "/" at the end of prefix, otherwise the mongrel can't be started.

I cannot verify the error, it works fine for me. If you're having difficulties, you may want to try the change...

TvE 10:55, 21 November 2006 (PST)




  • Some capistrano stuff

If you got a problem from capistrano on windows then it may be the same as what I got. The problem stems from the installation of mongrel_cluster. By default it tries to install the latest one which depends on latest mongrel which is not working well with windows. So I have tried the following version and it works well on windows: gem install mongrel_cluster -v 0.2.0 is the correct version. of course it depends on mongrel 0.3.13.3-mswin32 version which will be asked for when you try to install it.

For the capistrano tasks if you are wondering about the execution order or where to edit tasks then here is what I found:

 ######################################################################################################################
    ########## capistrano tasks #############
    ######################################################################################################################

    ######## Initial tasks are ########

    cap setup # ===> from require capistrano
    cap cold_deploy # ===> from require capistrano
    cap restart_web # ===> from deploy.rb

    ######## repeatable tasks are ########

    cap deploy # ===> from require capistrano

    ######################################################################################################################

    ############# Tasks executed by setup  ##########################

    before_setup # ===> from deploy.rb
    after_setup # ===> from deploy.rb

    ############# Tasks executed by cold_deploy  ##########################

    deploy # ===> from require capistrano
    update # ===> from require capistrano
    -- transaction: start: # not a task
    update_code # ===> from require capistrano
    after_update_code  # ===> from deploy.rb
    symlink # ===> from require capistrano
    -- transaction: commit # not a task
    restart # ===> from require capistrano
    restart_mongrel_cluster # ===> from require mongrel_cluster/recipes
    stop_mongrel_cluster # ===> from require mongrel_cluster/recipes
    start_mongrel_cluster # ===> from require mongrel_cluster/recipes

    ############# Tasks executed with restart  (NOT restart_web)##########################

    restart_mongrel_cluster # ===> from require mongrel_cluster/recipes
    stop_mongrel_cluster # ===> from require mongrel_cluster/recipes
    start_mongrel_cluster # ===> from require mongrel_cluster/recipes

One last thing. In deploy.rb do not try to be too smart (as I did) and use: set :mongrel_conf, '/etc/mongrel_cluster/#{application}.yml' with application variable. This caused me problems until I changed it and hard coded the project name.

Hope this helps. Muath


Muath: thanks for the info! On my Windows box I am using mongrel_cluster 0.2.1 and mongrel 0.3.13.4. I was not aware of the fact that there is a newer mongrel that doesn't like Windows. Oh well...

TvE 21:29, 25 November 2006 (PST)


Had some problems runing the automated capistrano deployments: cold_deploy failed when I did not have the 'tmp' folder in svn. Make sure this is checked in, but don't add all the session files.

I had to add a line sudo "rm -f #{release_path}/config/mongrel_cluster.yml" before the line sudo "ln -s #{deploy_to}/#{shared_dir}/config/mongrel_cluster.yml #{release_path}/config/mongrel_cluster.yml" in the after code update section. My script failed when it failed to create a symlink when the target file already existed.

asm


Asm: thanks for the info, I'll try to fix these things in the next image!

TvE 00:35, 29 November 2006 (PST)


In the instructions for multiple servers, the line:

Changed /etc/rails/project.conf to have address 0.0.0.0 instead of 127.0.0.1

should read:

Changed /etc/mongrel_cluster/project.yml to have address 0.0.0.0 instead of 127.0.0.1

Marco 23:41, 2 December 2006 (PST)

Marco: Thanks!

TvE 11:01, 3 December 2006 (PST)

Personal tools