summaryrefslogtreecommitdiff
path: root/lib/oxidized/node.rb
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2016-02-23 00:31:55 +0200
committerytti <saku@ytti.fi>2016-02-23 00:31:55 +0200
commit1d6be9c011a9195626f59d3d62ac2febe9dd3149 (patch)
tree01eb7f3d336aaeb90347510afb32715bd7c042bc /lib/oxidized/node.rb
parent2543d95d150844eb6e619f6c99dd26fc9b1d1084 (diff)
parent69210c7ddf7d77cc9eb7b78f0bc00ad2f1475955 (diff)
Merge pull request #326 from danilopopeye/group-remotes-and-hooks
multiple remotes for groups in GithubRepo hook
Diffstat (limited to 'lib/oxidized/node.rb')
-rw-r--r--lib/oxidized/node.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/oxidized/node.rb b/lib/oxidized/node.rb
index 7a278a9..35bcad9 100644
--- a/lib/oxidized/node.rb
+++ b/lib/oxidized/node.rb
@@ -24,7 +24,7 @@ module Oxidized
@vars = opt[:vars]
@stats = Stats.new
@retry = 0
- @repo = Oxidized.config.output.git.repo
+ @repo = resolve_repo
# model instance needs to access node instance
@model.node = self
@@ -170,5 +170,15 @@ module Oxidized
Oxidized.mgr.model[model].new
end
+ def resolve_repo
+ remote_repo = Oxidized.config.output.git.repo
+
+ if Oxidized.config.output.git.single_repo? || @group.nil? || remote_repo.is_a?(String)
+ remote_repo
+ else
+ remote_repo[@group]
+ end
+ end
+
end
end