- From: Tim Uckun <
>
- To: chef <
>
- Subject: [chef] Trying to deploy a rails app but having some issues.
- Date: Thu, 5 Jan 2012 16:15:32 +1300
Hey all I am trying to deploy a rails app. I was going to use the
application cookbook but decided to try and go at it myself. I have
gotten to the stage where it checkout the source code and handles the
submodules but the symlinking doesn't seem to be working properly.
Specifically the log symlink. Instead of symlinking the log directory
it creates a log symlink inside of the log directory which would mean
the logs would have to be in RAILS_ROOT/log/log/production.log Is
this a bug in the deploy resource?
BTW....
What do you guys think about putting a deploy.rb someplace and
shelling out to cap deploy?
Here is the recipe so far
app_path = "#{app[:path]}/#{app[:environment]}"
%w(bundle cached-copy config log pids system).each do |dir|
directory app_path do
owner app[:user]
group app[:user]
mode "0755"
action :create
recursive true
end
end
%w(bundle cached-copy config log pids system).each do |dir|
directory "#{app_path}/shared/#{dir}" do
owner app[:user]
group app[:user]
mode "0755"
action :create
recursive true
end
end
#has other dependencies...
deploy app_path do
repo app[:repo]
revision app[:revision]
user app[:user]
enable_submodules true
migrate false
migration_command "bundle exec rake db:migrate"
environment "RAILS_ENV" => "production", "OTHER_ENV" => "foo"
shallow_clone true
create_dirs_before_symlink %w{log config pids system tmp}
action :deploy # or :rollback
restart_command "touch tmp/restart.txt"
scm_provider Chef::Provider::Git # is the default, for svn:
Chef::Provider::Subversion
end
- [chef] Trying to deploy a rails app but having some issues., Tim Uckun, 01/04/2012
Archive powered by MHonArc 2.6.16.