After capistrano deploy my ckeditor_assets are being removed. Could not symlink to shared/ckeditor_assets folder.
I have followed this step :
namespace :uploads do
desc <<-EOD
Creates the upload folders unless they exist
and sets the proper upload permissions.
EOD
task :setup, :except => { :no_release => true } do
dirs = uploads_dirs.map { |d| File.join(shared_path, d) }
run "#{try_sudo} mkdir -p #{dirs.join(' ')} && #{try_sudo} chmod g+w #{dirs.join(' ')}"
end
desc <<-EOD
[internal] Creates the symlink to uploads shared folder
for the most recently deployed version.
EOD
task :symlink, :except => { :no_release => true } do
run "rm -rf #{release_path}/public/ckeditor_assets"
run "ln -nfs #{shared_path}/ckeditor_assets #{release_path}/public/ckeditor_assets"
end
desc <<-EOD
[internal] Computes uploads directory paths
and registers them in Capistrano environment.
EOD
task :register_dirs do
set :uploads_dirs, %w(public/ckeditor_assets)
set :shared_children, fetch(:shared_children) + fetch(:uploads_dirs)
end
after "deploy:finalize_update", "uploads:symlink"
on :start, "uploads:register_dirs"
end
I could not figure this out why my public/ckeditor_assets folder is not copied to shared/ckeditor_assets and doesnt symlink also.
Just so you we are clear, you do realise that these cap tasks delete public/ckeditor_assets ? They then symlink to shared/ckeditor_assets, but obviously that needs to be created by you.The setup task does look like it is half trying to do that but you don’t seem to be invoking it, furthermore it would seem to be creating shared/public/ckeditor_assets rather than shared/ckeditor_assets
task :register_dirs do
set :uploads_dirs, %w(public/ckeditor_assets)
set :shared_children, fetch(:shared_children) + fetch(:uploads_dirs)
end
probably you are saying about this to create a directory for shared/ckeditor_assets where as this is creating a folder shared/public/ckeditor_assets. I have cheked the folders there are no folders such like that after deplyment.
Also for deleting public/ckeditor_assets… yes i think it gets deleted and after the deployment I can not able to fetch this directory also.
Shall I need to change anything except this in my deploy.rb.