Skip to content
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

rsync being run twice #16

Open
fazy opened this issue Jun 9, 2014 · 0 comments
Open

rsync being run twice #16

fazy opened this issue Jun 9, 2014 · 0 comments

Comments

@fazy
Copy link

fazy commented Jun 9, 2014

Using capistrano 3.2.1 and capistrano-rsync 1.0.2, I managed to get a very basic example working, with a single Capfile like this.

However, if I try to make the directory structure used by Capistrano, I see the rsync command is run twice.

Here are my files:

./Capfile

require 'capistrano/setup'
require 'capistrano/deploy'
require "capistrano/rsync"

Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

./config/deploy.rb

set :application, "My Application"
set :repo_url, "[email protected]:XXX/XXX.git"
set :branch, "master"
set :deploy_to, "/var/www/test"
set :rsync_options, %w[--recursive --delete --delete-excluded  --exclude .git*]
set :scm, :rsync

namespace :rsync do
  task :set_current_revision do
    # nothing
  end
end

./config/deploy/dev.rb

server 'myserver', user: 'deploy', roles: %w{web}

(I added myserver to my hosts file for this example).

If I now run cap dev deploy, I get this output:

#!text
INFO[ee7cbc5d] Running /usr/bin/env mkdir -pv /var/www/test/shared /var/www/test/releases on myserver
DEBUG[ee7cbc5d] Command: /usr/bin/env mkdir -pv /var/www/test/shared /var/www/test/releases
INFO[ee7cbc5d] Finished in 0.152 seconds with exit status 0 (successful).
DEBUG[d2719cce] Running /usr/bin/env [ -f /var/www/test/current/REVISION ] on myserver
DEBUG[d2719cce] Command: [ -f /var/www/test/current/REVISION ]
DEBUG[d2719cce] Finished in 0.007 seconds with exit status 0 (successful).
DEBUG[73100218] Running /usr/bin/env cat /var/www/test/current/REVISION 2>/dev/null on myserver
DEBUG[73100218] Command: /usr/bin/env cat /var/www/test/current/REVISION 2>/dev/null
DEBUG[73100218]
DEBUG[73100218] Finished in 0.009 seconds with exit status 0 (successful).
HEAD is now at f3652d4 Merged in DEV-3008-support-release-version (pull request #3)
HEAD is now at f3652d4 Merged in DEV-3008-support-release-version (pull request #3)
skipping directory .
skipping directory .
INFO[c14f82bc] Running /usr/bin/env rsync --archive --acls --xattrs "/var/www/test/shared/deploy/" "/var/www/test/releases/20140609162536/" on myserver
DEBUG[c14f82bc] Command: rsync --archive --acls --xattrs "/var/www/test/shared/deploy/" "/var/www/test/releases/20140609162536/"
INFO[c14f82bc] Finished in 0.056 seconds with exit status 0 (successful).
INFO[7dd47543] Running /usr/bin/env rsync --archive --acls --xattrs "/var/www/test/shared/deploy/" "/var/www/test/releases/20140609162536/" on myserver
DEBUG[7dd47543] Command: rsync --archive --acls --xattrs "/var/www/test/shared/deploy/" "/var/www/test/releases/20140609162536/"
INFO[7dd47543] Finished in 0.052 seconds with exit status 0 (successful).
DEBUG[4c4ef630] Running /usr/bin/env if test ! -d /var/www/test/releases/20140609162536; then echo "Directory does not exist '/var/www/test/releases/20140609162536'" 1>&2; false; fi on myserver
DEBUG[4c4ef630] Command: if test ! -d /var/www/test/releases/20140609162536; then echo "Directory does not exist '/var/www/test/releases/20140609162536'" 1>&2; false; fi
DEBUG[4c4ef630] Finished in 0.007 seconds with exit status 0 (successful).
INFO[501e7e1b] Running /usr/bin/env echo "" >> REVISION on myserver
DEBUG[501e7e1b] Command: cd /var/www/test/releases/20140609162536 && /usr/bin/env echo "" >> REVISION
INFO[501e7e1b] Finished in 0.008 seconds with exit status 0 (successful).
INFO[7dcba5ac] Running /usr/bin/env rm -rf /var/www/test/current on myserver
DEBUG[7dcba5ac] Command: /usr/bin/env rm -rf /var/www/test/current
INFO[7dcba5ac] Finished in 0.008 seconds with exit status 0 (successful).
INFO[28029ffa] Running /usr/bin/env ln -s /var/www/test/releases/20140609162536 /var/www/test/current on myserver
DEBUG[28029ffa] Command: /usr/bin/env ln -s /var/www/test/releases/20140609162536 /var/www/test/current
INFO[28029ffa] Finished in 0.009 seconds with exit status 0 (successful).
DEBUG[fd3953a8] Running /usr/bin/env ls -x /var/www/test/releases on myserver
DEBUG[fd3953a8] Command: /usr/bin/env ls -x /var/www/test/releases
DEBUG[fd3953a8]         20140609161334  20140609161407  20140609161443  20140609161503  20140609162526
DEBUG[fd3953a8]         20140609162536
DEBUG[fd3953a8] Finished in 0.009 seconds with exit status 0 (successful).
INFOKeeping 5 of 6 deployed releases on myserver
INFO[301da6e1] Running /usr/bin/env rm -rf /var/www/test/releases/20140609161334 on myserver
DEBUG[301da6e1] Command: /usr/bin/env rm -rf /var/www/test/releases/20140609161334
INFO[301da6e1] Finished in 0.008 seconds with exit status 0 (successful).
DEBUG[c64fd4e6] Running /usr/bin/env if test ! -d /var/www/test/releases; then echo "Directory does not exist '/var/www/test/releases'" 1>&2; false; fi on myserver
DEBUG[c64fd4e6] Command: if test ! -d /var/www/test/releases; then echo "Directory does not exist '/var/www/test/releases'" 1>&2; false; fi
DEBUG[c64fd4e6] Finished in 0.005 seconds with exit status 0 (successful).
INFO[37a721d7] Running /usr/bin/env echo "Branch master (at ) deployed as release 20140609162536 by lars" >> /var/www/test/revisions.log on myserver
DEBUG[37a721d7] Command: echo "Branch master (at ) deployed as release 20140609162536 by lars" >> /var/www/test/revisions.log
INFO[37a721d7] Finished in 0.005 seconds with exit status 0 (successful).

So, why the duplicated git commands (HEAD is now at f3652d4 ...) and rsync commands (INFO[c14f82bc] Running /usr/bin/env rsync ...)?

ezekg pushed a commit to ezekg/capistrano-rsync that referenced this issue Jan 4, 2016
…modules-before-update

Added clean submodule directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant