r10k 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/r10k/cli.rb +1 -0
- data/lib/r10k/cli/cache.rb +2 -2
- data/lib/r10k/cli/ext/logging.rb +16 -0
- data/lib/r10k/cli/module/deploy.rb +2 -1
- data/lib/r10k/cli/synchronize.rb +1 -3
- data/lib/r10k/root.rb +4 -1
- data/lib/r10k/version.rb +1 -1
- metadata +2 -1
data/lib/r10k/cli.rb
CHANGED
data/lib/r10k/cli/cache.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'r10k/cli'
|
2
2
|
require 'r10k/synchro/git'
|
3
3
|
require 'cri'
|
4
|
+
require 'r10k/logging'
|
4
5
|
|
5
6
|
module R10K::CLI
|
6
7
|
module Cache
|
@@ -12,7 +13,6 @@ module R10K::CLI
|
|
12
13
|
|
13
14
|
run do |opts, args, cmd|
|
14
15
|
sources = R10K::Deployment.instance[:sources]
|
15
|
-
|
16
16
|
remotes = Set.new
|
17
17
|
|
18
18
|
sources.each_pair do |name, hash|
|
@@ -20,7 +20,7 @@ module R10K::CLI
|
|
20
20
|
end
|
21
21
|
|
22
22
|
remotes.each do |remote|
|
23
|
-
|
23
|
+
logger.info "Synchronizing #{remote}"
|
24
24
|
synchro = R10K::Synchro::Git.new(remote)
|
25
25
|
synchro.cache
|
26
26
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'cri/command_dsl'
|
2
|
+
require 'r10k/logging'
|
3
|
+
|
4
|
+
module Cri
|
5
|
+
class CommandDSL
|
6
|
+
include R10K::Logging
|
7
|
+
|
8
|
+
def logger
|
9
|
+
unless @logger
|
10
|
+
@logger = Log4r::Logger.new(@command.name)
|
11
|
+
@logger.add R10K::Logging.outputter
|
12
|
+
end
|
13
|
+
@logger
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'r10k/cli/module'
|
2
2
|
require 'r10k/deployment'
|
3
|
+
require 'r10k/logging'
|
3
4
|
require 'cri'
|
4
5
|
|
5
6
|
require 'fileutils'
|
@@ -33,7 +34,7 @@ module R10K::CLI::Module
|
|
33
34
|
mods = env.modules.select { |mod| mod.name == module_name }
|
34
35
|
|
35
36
|
if mods.empty?
|
36
|
-
|
37
|
+
logger.warn "No modules with name #{module_name} matched in environment #{env.name.inspect}".red
|
37
38
|
end
|
38
39
|
|
39
40
|
stack = Middleware::Builder.new
|
data/lib/r10k/cli/synchronize.rb
CHANGED
@@ -13,8 +13,6 @@ module R10K::CLI
|
|
13
13
|
usage 'synchronize <options>'
|
14
14
|
summary 'Fully synchronize all environments'
|
15
15
|
|
16
|
-
flag :u, :update, "Update cache before running"
|
17
|
-
|
18
16
|
run do |opts, args, cmd|
|
19
17
|
deployment = R10K::Deployment.instance
|
20
18
|
environments = deployment.environments
|
@@ -31,7 +29,7 @@ module R10K::CLI
|
|
31
29
|
end
|
32
30
|
|
33
31
|
stack_env = {
|
34
|
-
:update_cache =>
|
32
|
+
:update_cache => true,
|
35
33
|
:trace => opts[:trace],
|
36
34
|
:recurse => true,
|
37
35
|
}
|
data/lib/r10k/root.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
require 'r10k'
|
2
2
|
require 'r10k/module'
|
3
3
|
require 'r10k/synchro/git'
|
4
|
+
require 'r10k/logging'
|
4
5
|
|
5
6
|
class R10K::Root
|
6
7
|
|
8
|
+
include R10K::Logging
|
9
|
+
|
7
10
|
# @!attribute [r] name
|
8
11
|
# The directory name of this root
|
9
12
|
attr_reader :name
|
@@ -49,7 +52,7 @@ class R10K::Root
|
|
49
52
|
R10K::Module.new(name, "#{full_path}/modules", args)
|
50
53
|
end
|
51
54
|
rescue Errno::ENOENT
|
52
|
-
|
55
|
+
logger.warn "#{self}: #{full_path} does not exist, cannot enumerate modules."
|
53
56
|
[]
|
54
57
|
end
|
55
58
|
|
data/lib/r10k/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r10k
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -126,6 +126,7 @@ files:
|
|
126
126
|
- lib/r10k/cli/environment/list.rb
|
127
127
|
- lib/r10k/cli/environment/stale.rb
|
128
128
|
- lib/r10k/cli/environment.rb
|
129
|
+
- lib/r10k/cli/ext/logging.rb
|
129
130
|
- lib/r10k/cli/module/deploy.rb
|
130
131
|
- lib/r10k/cli/module/list.rb
|
131
132
|
- lib/r10k/cli/module.rb
|