r10k 1.3.2 → 1.3.3
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.
- checksums.yaml +8 -8
- data/CHANGELOG.mkd +25 -0
- data/lib/r10k/cli/puppetfile.rb +6 -4
- data/lib/r10k/deployment/basedir.rb +27 -26
- data/lib/r10k/source/git.rb +4 -4
- data/lib/r10k/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjFlMGI2ZTNiYjgwYmU0YmExOWZiYTUyMDU0ZWY5NzNjOTUxMDgwMg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
OTc1ZTk4Y2Y2NWY5NDg5NmY2NDEyZTUyMDBhZWRmNGZjZjk0MjgwYw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NGRkZGIyNGI2ZWIzODk5NjBkN2Q2N2RhMWFmODk1N2NjYTNlYzFjMGM4NDJk
|
10
|
+
NzQ3MzkzMTEzNjY5MmMyZjdlZjFiMjIwZTY1MzQ1ZjRhZTg4MTQyN2EwYzlh
|
11
|
+
YzYyMTU3ZWY3ODZkOTBlMjJmOGU4OWNkZTY4ZDgzMDgzOTc4MzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NmYzODIzY2YzM2QxNzllNWUzNTIyYTVhODgyZGQ2ODIzNjBkZDZkN2JkYmNk
|
14
|
+
YzliY2Q2OGRiM2U5MWRlNzFlM2Q1Y2VkYjk3NGI1ODRhOTQ4NjQxYTk0YWMx
|
15
|
+
ZjdjZmVhYTBhOTIwNGY5OTlmYmQzZjFjNWRhOTJlZmIwOWU3Njk=
|
data/CHANGELOG.mkd
CHANGED
@@ -1,6 +1,31 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
+
1.3.3
|
5
|
+
-----
|
6
|
+
|
7
|
+
2014/09/11
|
8
|
+
|
9
|
+
### User notes
|
10
|
+
|
11
|
+
(GH-178) Failing to fetch a source git repo can wipe out environments
|
12
|
+
|
13
|
+
When updating Git sources at the beginning of a deployment, if the fetch was
|
14
|
+
interrupted r10k could cache an empty list of environments. This could cause
|
15
|
+
r10k to remove all environments for that source. This was due to a method
|
16
|
+
directly using a value that was supposed to be lazily evaluated and memoized. It
|
17
|
+
has been fixed so that even if r10k cannot fetch a source it will still be able
|
18
|
+
to deploy modules for environments, clean up removed environments, and correctly
|
19
|
+
remove unmanaged environments.
|
20
|
+
|
21
|
+
(GH-186) Rescue SyntaxError when checking Puppetfile syntax
|
22
|
+
|
23
|
+
When a Puppetfile with invalid syntax is parsed it raises a SyntaxError,
|
24
|
+
and the `r10k puppetfile check` code was not specifically handling that.
|
25
|
+
Thus when checking an invalid file r10k was actually crashing and not
|
26
|
+
gracefully handling the error. This was fixed to cleanly rescue the SyntaxError,
|
27
|
+
optionally print stacktraces, and print an all ok message on success.
|
28
|
+
|
4
29
|
1.3.2
|
5
30
|
-----
|
6
31
|
|
data/lib/r10k/cli/puppetfile.rb
CHANGED
@@ -63,13 +63,15 @@ Puppetfile (http://bombasticmonkey.com/librarian-puppet/).
|
|
63
63
|
puppetfile = R10K::Puppetfile.new(puppetfile_root, puppetfile_path, puppetfile)
|
64
64
|
begin
|
65
65
|
puppetfile.load
|
66
|
-
rescue LoadError =>
|
67
|
-
$stderr.puts "ERROR:
|
68
|
-
|
69
|
-
|
66
|
+
rescue SyntaxError, LoadError => e
|
67
|
+
$stderr.puts "ERROR: Could not parse Puppetfile"
|
68
|
+
$stderr.puts e.message
|
69
|
+
if opts[:trace]
|
70
|
+
$stderr.puts e.backtrace.join("\n")
|
70
71
|
end
|
71
72
|
exit 1
|
72
73
|
end
|
74
|
+
puts "Syntax OK"
|
73
75
|
exit 0
|
74
76
|
end
|
75
77
|
end
|
@@ -3,36 +3,37 @@ require 'r10k/deployment/environment'
|
|
3
3
|
require 'r10k/util/purgeable'
|
4
4
|
|
5
5
|
module R10K
|
6
|
-
class Deployment
|
7
|
-
class Basedir
|
8
|
-
# Represents a directory containing environments
|
6
|
+
class Deployment
|
9
7
|
|
10
|
-
|
11
|
-
@
|
12
|
-
|
13
|
-
end
|
8
|
+
# Represents a directory containing environments
|
9
|
+
# @api private
|
10
|
+
class Basedir
|
14
11
|
|
15
|
-
|
12
|
+
def initialize(path,deployment)
|
13
|
+
@path = path
|
14
|
+
@deployment = deployment
|
15
|
+
end
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
17
|
+
include R10K::Util::Purgeable
|
18
|
+
|
19
|
+
# Return the path of the basedir
|
20
|
+
# @note This implements a required method for the Purgeable mixin
|
21
|
+
# @return [String]
|
22
|
+
def managed_directory
|
23
|
+
@path
|
24
|
+
end
|
23
25
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
# List all environments that should exist in this basedir
|
27
|
+
# @note This implements a required method for the Purgeable mixin
|
28
|
+
# @return [Array<String>]
|
29
|
+
def desired_contents
|
30
|
+
@deployment.sources.inject([])do |list, source|
|
31
|
+
if source.managed_directory == @path
|
32
|
+
list += source.desired_contents
|
33
|
+
end
|
34
|
+
list
|
35
|
+
end
|
36
|
+
end
|
32
37
|
end
|
33
|
-
@keepers
|
34
38
|
end
|
35
|
-
|
36
|
-
end
|
37
|
-
end
|
38
39
|
end
|
data/lib/r10k/source/git.rb
CHANGED
@@ -75,10 +75,10 @@ class R10K::Source::Git < R10K::Source::Base
|
|
75
75
|
def environments
|
76
76
|
if not @cache.cached?
|
77
77
|
[]
|
78
|
-
elsif
|
79
|
-
@environments
|
80
|
-
else
|
78
|
+
elsif @environments.empty?
|
81
79
|
@environments = generate_environments()
|
80
|
+
else
|
81
|
+
@environments
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
@@ -120,7 +120,7 @@ class R10K::Source::Git < R10K::Source::Base
|
|
120
120
|
# @note This implements a required method for the Purgeable mixin
|
121
121
|
# @return [Array<String>]
|
122
122
|
def desired_contents
|
123
|
-
|
123
|
+
environments.map {|env| env.dirname }
|
124
124
|
end
|
125
125
|
|
126
126
|
private
|
data/lib/r10k/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r10k
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrien Thebo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|