I am trying to setup Capistrano deployment for my website, I have got the deploy working, all authentication fine, but I host with Media temple so the default symlink will not work as apache won't have access to the path specified for current to the latest release.
I am trying to make a task that will unlink the current symlink, then recreate it with a relative path, however the Capistrano documentation is severely lacking and I cannot find any more information anywhere of how exactly to set this up.
I have tried using sh, but that seems to run the commands on my computer rather than on the server, run command is not found, and I tried execute but cannot find the right format to do things like rm, or ln, etc...
Currently I am trying the following:
namespace :deploy do
desc "Change HTML Symlink to relative path"
task :create_symlink do
#latest_release_relative = relative_path(deploy_to, release_path + '/html')
#sh "rm -f #{current_path} && ln -s #{latest_release_relative} #{current_path}"
#sh "echo #{File.basename release_path}"
info "echo Modifying symlink to be relative"
#run "rm -d #{current_path}"
#run "ln releases/#{File.basename release_path} #{current_path}"
#execute :rm, '-d', #{current_path}
end
desc "Create environment file"
task :create_env_conf
file 'env.conf' do |t|
sh "touch env.conf"
end
end
after :deploy, "deploy:create_symlink", "deploy:create_env_conf"