capistrona ruby on rails and plesk some deployment problems

58 views
Skip to first unread message

rubybox

unread,
Feb 9, 2010, 2:51:53 PM2/9/10
to Capistrano
Hi everyone

Fairly new to ruby and cap but ive did research before posting.

Im deploying to a centos VPS with plesk.
This means I set the document roots from /var/www/vhosts/mydomain.com/
httpdocs to /rubydocs/domain.com/myapp/current

So far so good,
But I also need to

* Change file permissions on that domain.com to domain:psaserv
Tried this several times but it does not work
* I need to be able to create a database for my application currently
i have do this manually with mysql admin from the command line.
I wondered if this can be automated with cap ?

Hope this is in the right group,
anyone can guide me to some good howtos concerning cap, ruby on rails
and plesk or anyone so kind to share a recipe for the above 2
problems?
Thanks in advanche!

Lee Hambley

unread,
Feb 14, 2010, 8:30:07 AM2/14/10
to capis...@googlegroups.com
Hi Rubybox,

Sorry that your question went unanswered, is this still a problem for you?

-- Lee Hambley

Twitter: @leehambley | @capistranorb

rubybox

unread,
Mar 1, 2010, 11:52:31 AM3/1/10
to Capistrano
Hi thanks,

I haven tlooked into this after coudent get it to work.
The problem still exists but since i did not have to deploy yet I did
changes manually in ssh session on my server.

The problems are still exists. And I havent been able to find solution


1) Change file /group permissions on deploy directory to
domainname:psaserv
2) Creating datbase ( I guess I do that manually with plesk, since I
wont deploy more than a few apps anyway so this is not a big deal )


This is my current deploy.rb, could you point me to how to correct it
so it works?
Would highly appreciate, thanks. Changed some data so could be some
typo in it but it works without the file permissions

http://pastie.org/848333

Rafael G.

unread,
Mar 2, 2010, 4:54:15 PM3/2/10
to capis...@googlegroups.com
This code don't have any garantee, I wrote it on the fly. I hope you get
the idea.

For permissions problem:

after "deploy", :change_permissions
after "deploy:migrations", :change_permissions

desc "Change permissions"
task :change_permissions, :roles => [ :app, :db, :web ] do
sudo "chown -R domain:psaserv #{deploy_to}"
end

To create a database:
desc "Create database"
task :create_database, :roles => [ :app, :db, :web ] do
run "cd #{current_path} && rake RAILS_ENV=production db:create"
end

Regards


--
Rafa

Reply all
Reply to author
Forward
0 new messages