-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation should be clear #24
Comments
@lemsx1 you're right, the documentation is a bit lacking. I'll try to update on that whenever I get some time. However, if you'd like to see things speed up a bit, feel free to make some suggestions through a pull request :) |
Yes, I know. I've tried to get the sync from tmp/deploy to shared/deploy to work. I read the source and still can't figure it out. This feels like black magic to me since I've never used Capistrano and it has way too many triggers. Even the debug trace doesn't show the "rsync" task ever being called. |
Ok, I was able to figure it out. Here is my configuration which might help others reading this issue:
group :development do
# Deploy with Capistrano
gem 'capistrano', '~> 3.4'
gem 'capistrano-rails', '~> 1.1'
gem 'capistrano-passenger'
gem 'capistrano-rsync-bladrak'
end
require 'capistrano/setup' # this loads capistrano/rsync.rb automatically because of: set :scm, :rsync
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails'
require 'capistrano/passenger'
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
set :application, 'myapp'
set :rsync_options, %w[
--recursive --delete --delete-excluded
--exclude .git*
--exclude /config/database.yml
--exclude /test/***
]
set :repo_url, 'ssh://server/git/myapp'
unless ENV['RAILS_ENV'] == 'production'
ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
end
set :deploy_to, '/srv/apps/myapp'
set :scm, :rsync
namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
within release_path do
execute :rake, 'tmp:create'
execute :rake, 'tmp:clear'
end
end
end
# ...
end I hope this helps somebody... Please update the documentation with this working example. |
Thanks for your report @lemsx1 :) I'll update the documentation accordingly when I get some time. I'm guessing most of your issues came from the existing capistrano-rsync install; I'll add a mention about uninstalling it first, and a reference to your issue as well. |
I noticed that although this is a recent fork of capistrano-rsync, the documentation seems to not have been updated much.
I'm trying to wrap my head around how this is working and since I don't know much about capistrano, it seems to be extra hard especially since the documentation provided does not provide a working system.
Please update the documentation so it produces a working example of:
With the current configuration in README, #1 and #3 are done, only if I manually do: rsync -a tmp/deploy server:/path/to/shared/. This is the whole point of using capistrano-rsync-* so I dunno why it doesn't do just that.
The text was updated successfully, but these errors were encountered: