Deployment help

5 views
Skip to first unread message

Jillian

unread,
Jul 1, 2009, 10:41:12 PM7/1/09
to Capistrano
Hi,

I am trying to have a wiki on the same domain as my rails
application. I use capistrano to deploy the rails app, and I figured
that the best way to go about this would be to have a symlink from the
public_html directory to the wiki directory. However, every time I
redeploy the rails application, the symlink is overwritten, and the
tasks I write within deploy.rb to create this symlink do not seem to
work. Any assistance would be much appreciated.

Thanks,
Jillian

Lee Hambley

unread,
Jul 2, 2009, 5:19:51 AM7/2/09
to capis...@googlegroups.com
Jillian, please paste your deploy.rb - particularly the task definition to make the symlink and the hook to insert that into the execution chain.

-- Lee

2009/7/2 Jillian <jil...@gmail.com>

John Kolen

unread,
Jul 2, 2009, 9:46:20 AM7/2/09
to capis...@googlegroups.com
How about putting the wiki symlink in shared/system directory?

Donovan Bray

unread,
Jul 2, 2009, 10:37:58 AM7/2/09
to capis...@googlegroups.com
What's the task look like and I would suggest creating the symlink
with an after hook of deploy:update_code or a before deploy:symlink

Jillian

unread,
Jul 4, 2009, 12:59:43 AM7/4/09
to Capistrano
I'm probably going about this all wrong, here's the deploy.rb file:

###### START DEPLOY.RB ######

# Your cPanel/SSH login name

set :user , "root"



# The domain name of the server to deploy to, this can be your domain
or the domain of the server.

set :server_name, "sswl.railsplayground.net"



# Your svn / git login name

set :scm_username , "jek339"

set :scm_password, "lw0rdr0"



# Your repository type, by default we use subversion.

set :scm, :subversion


# The name of your application, this will also be the folder were your
application

# will be deployed to

set :application, "SSWL"

set :domain, "sswl.railsplayground.net"

# the url for your repository

set :repository, "http://sswl.svnrepository.com/svn/SSWL/trunk/SSWL"




set :deploy_to, "/home/sv620/#{application}"

set :current, "#{deploy_to}/current"

set :use_sudo, false

set :group_writable, false

default_run_options[:pty] = true

# add the options re: the staging/production servers here

role :app, "sswl.railsplayground.net"

role :web, "sswl.railsplayground.net"

role :db, "sswl.railsplayground.net", :primary => true



# set the proper permission of the public folder

task :after_update_code, :roles => [:web, :db, :app] do

run "chmod 755 #{release_path}/public"

run "chmod 755 #{release_path}/public/dispatch.fcgi"

run "chmod 755 #{release_path}/public/dispatch.cgi"

run "chown sv620:sv620 #{release_path} -R"

run "ln -s #/home/sv620/wiki ~/public_html/wiki"

end




namespace :deploy do

desc "cold deploy"

task :cold do

update

fastcgi::create_public_link

fastcgi::restart

end



desc "restart dispatchers"

task :restart do

fastcgi::restart

end



end




namespace :fastcgi do

desc "Restart dispatchers"

task :restart do

run "killall -9 dispatch.fcgi"

end



desc "Create symbolic link"

task :create_public_link do

run "cd /home/sv620; mv public_html public_html_bk; ln -s #
{current_path}/public ~/public_html"

end


end



###### END DEPLOY.RB ######


On Jul 2, 10:37 am, Donovan Bray <donno...@gmail.com> wrote:
> What's the task look like and I would suggest creating the symlink  
> with an after hook of deploy:update_code or a before deploy:symlink
>
Reply all
Reply to author
Forward
Message has been deleted
0 new messages