Skip to content

Commit

Permalink
Merge pull request #14 from lweijl/master
Browse files Browse the repository at this point in the history
Gives the opportunity to define some other remote that origin
  • Loading branch information
Bladrak committed Jul 17, 2015
2 parents 6fb54b8 + ab9e0c7 commit 5dbb76a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.3.4 (Jul 17, 2015)
- Added ``:git_remote`` option. Gives the opportunity to define some other remote that ``origin``.

## 1.3.3 (Jul 15, 2015)
- Adds support for checking out revisions on top of tags and branches (rsync_checkout_tag is now deprecated)

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Name | Default | Description
--------------|---------|------------
repo_url | `.` | The path or URL to a Git repository to clone from.
branch | `master` | The Git branch to checkout.
git_remote | ``origin`` | The remote to use for Git checkout.
rsync_stage | `tmp/deploy` | Path where to clone your repository for staging, checkouting and rsyncing. Can be both relative or absolute.
rsync_cache | `shared/deploy` | Path where to cache your repository on the server to avoid rsyncing from scratch each time. Can be both relative or absolute.<br> Set to `nil` if you want to disable the cache.
rsync_options | `[]` | Array of options to pass to `rsync`.
Expand Down
9 changes: 6 additions & 3 deletions lib/capistrano/rsync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@

set_if_empty :rsync_target_dir, "."

# Creates opportunity to define remote other than origin
set_if_empty :git_remote, "origin"

set_if_empty :enable_git_submodules, false

set_if_empty :reset_git_submodules_before_update, false
Expand All @@ -50,18 +53,18 @@
rsync_target = lambda do
case fetch(:rsync_checkout)
when "tag"
target = "tags/#{fetch(:branch)}"
target = "#{fetch(:git_remote)}/tags/#{fetch(:branch)}"
when "revision"
target = fetch(:branch)
else
target = "origin/#{fetch(:branch)}"
target = "#{fetch(:git_remote)}/#{fetch(:branch)}"
end
target
end

rsync_branch = lambda do
if fetch(:rsync_checkout) == "tag"
branch = "tags/#{fetch(:branch)}"
branch = "#{fetch(:git_remote)}/tags/#{fetch(:branch)}"
else
branch = fetch(:branch)
end
Expand Down
2 changes: 1 addition & 1 deletion lib/capistrano/rsync/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Capistrano
module Rsync
VERSION = "1.3.3"
VERSION = "1.3.4"
end
end

0 comments on commit 5dbb76a

Please sign in to comment.