bladrak / capistrano-rsync Goto Github PK
View Code? Open in Web Editor NEWThis project forked from moll/capistrano-rsync
Deploy with Rsync from any local (or remote) repository when using Capistrano. Capistrano v3 ready!
License: Other
This project forked from moll/capistrano-rsync
Deploy with Rsync from any local (or remote) repository when using Capistrano. Capistrano v3 ready!
License: Other
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.
Hi there,
I am having trouble integrating capistrano-rsync in our deployment process. We sometimes want to deploy a tag and sometimes deploy a branch, both are supported and work well. But when we want to deploy a specific revision, there seems to be no simple way of doing this.
Looking at rsync.rb
rsync_target = lambda do
target = !!fetch(:rsync_checkout_tag, false) ? "tags/#{fetch(:branch)}" : "origin/#{fetch(:branch)}"
target
end
rsync_branch = lambda do
branch = !!fetch(:rsync_checkout_tag, false) ? "tags/#{fetch(:branch)}" : fetch(:branch)
branch
end
...
execute :git, :reset, '--quiet', '--hard', "#{rsync_target.call}"
Both the tags and origin statements are hardcoded, but for a revision this is where it breaks.
Hopefully the following example makes it more clear.
cd tmp/my-project/deploy && /usr/bin/env git reset --quiet --hard origin/1e7762bf60ab3694ec746d7f46623cb54278aacb
Should be something like this..
cd tmp/my-project/deploy && /usr/bin/env git reset --quiet --hard 1e7762bf60ab3694ec746d7f46623cb54278aacb
Is this a known issue or is there a fix I am overlooking?
I use jenkins to deploy and it fetches the repo already down to /var/lib/jenkins/workspace/my git repo/
Is there anyway to to bypass clone stage and use the files already there?
See this question on StackOverflow for a possible solution. Even if you have an alternate port set via Capistrano, it does not get set when rsync
is executed, resulting in a failed deployment. Let me know if you need some help and I'll be happy to issue a pull request.
Example server,
server "192.168.1.1:2222", {
# ...
}
Possible solution derived one of the StackOverflow answers:
"rsync -e 'ssh -p #{port}' user@remoteip:/path/to/files/ /local/path/"
hello,
i'm interested by your module.i need to use rsync for deploy my symfony websites.
so i have installed the extension capistrano-rsync and capistrano-rsync-bladrak.
in two cases, i get this error :
cap aborted!
NoMethodError: undefined method `name' for nil:NilClass
Tasks: TOP => rsync:create_release => rsync:release => rsync => rsync:stage_done => rsync:stage => rsync:create_stage
(See full trace by running task with --trace)
The deploy has failed with an error: undefined method `name' for nil:NilClass.
do you known the solution for resolve this problem.
i thank you very much for your help.
IT fails with:
02 git reset --quiet --hard origin/4.16.2
02 fatal: ambiguous argument 'origin/4.16.2': unknown revision or path not in the working tree.
02 Use '--' to separate paths from revisions, like this:
02 'git <command> [<revision>...] -- [<file>...]'
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Command::Failed: git exit status: 32768
git stdout: Nothing written
git stderr: fatal: ambiguous argument 'origin/4.16.2': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Tasks: TOP => rsync:create_release => rsync:release => rsync => rsync:stage_done => rsync:stage
(See full trace by running task with --trace)
The deploy has failed with an error: git exit status: 32768
git stdout: Nothing written
git stderr: fatal: ambiguous argument 'origin/4.16.2': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.