ra10ke 0.3.0 → 0.4.0
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 +5 -5
- data/CHANGELOG.md +17 -0
- data/lib/ra10ke.rb +26 -22
- data/lib/ra10ke/solve.rb +1 -1
- data/lib/ra10ke/version.rb +1 -1
- data/ra10ke.gemspec +2 -0
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 54a37104f6389b661c4b4a8673a2e9ad2dd502c02586b934dc948d94312eb0b6
|
4
|
+
data.tar.gz: aa3292d5cca1ebe7247e9796787d76fc7e79792d77fbef1c8274f15f9468ac16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cda904312f96b957f9a93b83ec9dee7a94fa2e200cf2ae2eb43781c15c10637f985f46ab7f6e7be114f1befd4486d8a156eb7166d9342428b52ec7a19738d0ec
|
7
|
+
data.tar.gz: 7bca30b657f0b072662b4aef38ae7269fa6a94d472a18ec0cad5270e05a06bc6b8f0b4aa7a3f165b281bf6755fae570358783a5d62c360bb4cf62d859a7f8145
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,23 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
+
0.4.0
|
5
|
+
-----
|
6
|
+
|
7
|
+
2018-06-17
|
8
|
+
|
9
|
+
* [#13](https://github.com/voxpupuli/ra10ke/pull/13) Avoid using `desired_ref` directly for Git
|
10
|
+
* [#14](https://github.com/voxpupuli/ra10ke/pull/14) Set required Ruby version as `>= 2.1.0`
|
11
|
+
* [#15](https://github.com/voxpupuli/ra10ke/pull/15) ignore invalid ref
|
12
|
+
* [#16](https://github.com/voxpupuli/ra10ke/pull/16) Use Semantic Versioning for Git tags
|
13
|
+
* [#17](https://github.com/voxpupuli/ra10ke/pull/17) Be careful around trimming Git tags
|
14
|
+
* [#19](https://github.com/voxpupuli/ra10ke/pull/19) Ensure Puppetfile gets parsed with absolute path
|
15
|
+
|
16
|
+
Many thanks to the following contributors for submitting the PRs:
|
17
|
+
* [Valter Jansons](https://github.com/sigv)
|
18
|
+
* [Martin Alfke](https://github.com/tuxmea)
|
19
|
+
* [Matthias Baur](https://github.com/baurmatt)
|
20
|
+
|
4
21
|
0.3.0
|
5
22
|
-----
|
6
23
|
|
data/lib/ra10ke.rb
CHANGED
@@ -3,6 +3,7 @@ require 'rake/tasklib'
|
|
3
3
|
require 'ra10ke/version'
|
4
4
|
require 'ra10ke/solve'
|
5
5
|
require 'git'
|
6
|
+
require 'semverse'
|
6
7
|
|
7
8
|
module Ra10ke
|
8
9
|
class RakeTask < ::Rake::TaskLib
|
@@ -14,7 +15,7 @@ module Ra10ke
|
|
14
15
|
require 'puppet_forge'
|
15
16
|
|
16
17
|
PuppetForge.user_agent = "ra10ke/#{Ra10ke::VERSION}"
|
17
|
-
puppetfile = R10K::Puppetfile.new(
|
18
|
+
puppetfile = R10K::Puppetfile.new(Dir.pwd)
|
18
19
|
puppetfile.load!
|
19
20
|
|
20
21
|
# ignore file allows for "don't tell me about this"
|
@@ -35,35 +36,38 @@ module Ra10ke
|
|
35
36
|
end
|
36
37
|
|
37
38
|
if puppet_module.class == R10K::Module::Git
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
# some guards to prevent unnessicary execution
|
39
|
+
# use helper; avoid `desired_ref`
|
40
|
+
# we do not want to deal with `:control_branch`
|
41
|
+
ref = puppet_module.version
|
42
42
|
next unless ref
|
43
|
-
next if ref == 'master'
|
44
43
|
|
44
|
+
remote = puppet_module.instance_variable_get(:@remote)
|
45
45
|
remote_refs = Git.ls_remote(remote)
|
46
46
|
|
47
47
|
# skip if ref is a branch
|
48
48
|
next if remote_refs['branches'].key?(ref)
|
49
49
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
50
|
+
if remote_refs['tags'].key?(ref)
|
51
|
+
# there are too many possible versioning conventions
|
52
|
+
# we have to be be opinionated here
|
53
|
+
# so semantic versioning (vX.Y.Z) it is for us
|
54
|
+
# as well as support for skipping the leading v letter
|
55
|
+
tags = remote_refs['tags'].keys
|
56
|
+
latest_tag = tags.map do |tag|
|
57
|
+
begin
|
58
|
+
Semverse::Version.new tag
|
59
|
+
rescue Semverse::InvalidVersionFormat
|
60
|
+
# ignore tags that do not comply to semver
|
61
|
+
nil
|
62
|
+
end
|
63
|
+
end.select { |tag| !tag.nil? }.sort.last.to_s.downcase
|
64
|
+
latest_ref = tags.detect { |tag| [tag.downcase, "v#{tag.downcase}"].include?(latest_tag) }
|
65
|
+
latest_ref = 'undef (tags do not match semantic versioning)' if latest_ref.nil?
|
66
|
+
elsif ref.match(/^[a-z0-9]{40}$/)
|
67
|
+
# for sha just assume head should be tracked
|
54
68
|
latest_ref = remote_refs['head'][:sha]
|
55
|
-
when 'tag'
|
56
|
-
# we have to be opinionated here, due to multiple conventions only the two main will be accepted
|
57
|
-
# v#.#.# or #.#.# is what we will pick.
|
58
|
-
if ref.match(/^[vV]?\d[\.\d]*/)
|
59
|
-
tags = remote_refs['tags']
|
60
|
-
version_tags = tags.select { |f| /^[vV]?\d[\.\d]*/.match(f) }
|
61
|
-
latest_ref = version_tags.keys.sort.last
|
62
|
-
else
|
63
|
-
latest_ref = "undef (tags don't match v#.#.# or #.#.#)"
|
64
|
-
end
|
65
69
|
else
|
66
|
-
raise "Unable to determine
|
70
|
+
raise "Unable to determine ref type for #{puppet_module.title}"
|
67
71
|
end
|
68
72
|
|
69
73
|
puts "#{puppet_module.title} is OUTDATED: #{ref} vs #{latest_ref}" if ref != latest_ref
|
@@ -76,7 +80,7 @@ module Ra10ke
|
|
76
80
|
require 'r10k/action/puppetfile/check'
|
77
81
|
|
78
82
|
puppetfile = R10K::Action::Puppetfile::Check.new({
|
79
|
-
:root =>
|
83
|
+
:root => Dir.pwd,
|
80
84
|
:moduledir => nil,
|
81
85
|
:puppetfile => nil
|
82
86
|
}, '')
|
data/lib/ra10ke/solve.rb
CHANGED
@@ -26,7 +26,7 @@ module Ra10ke::Solve
|
|
26
26
|
|
27
27
|
# Same as in the dependencies task, but oh well.
|
28
28
|
PuppetForge.user_agent = "ra10ke/#{Ra10ke::VERSION}"
|
29
|
-
puppetfile = R10K::Puppetfile.new(
|
29
|
+
puppetfile = R10K::Puppetfile.new(Dir.pwd)
|
30
30
|
puppetfile.load!
|
31
31
|
|
32
32
|
# ignore file allows for "don't tell me about this"
|
data/lib/ra10ke/version.rb
CHANGED
data/ra10ke.gemspec
CHANGED
@@ -14,10 +14,12 @@ Gem::Specification.new do |spec|
|
|
14
14
|
|
15
15
|
spec.files = `git ls-files`.split($/)
|
16
16
|
spec.require_paths = ["lib"]
|
17
|
+
spec.required_ruby_version = '>= 2.1.0'
|
17
18
|
|
18
19
|
spec.add_dependency "rake"
|
19
20
|
spec.add_dependency "puppet_forge"
|
20
21
|
spec.add_dependency "r10k"
|
21
22
|
spec.add_dependency "git"
|
22
23
|
spec.add_dependency "solve"
|
24
|
+
spec.add_dependency 'semverse', '~> 2.0'
|
23
25
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ra10ke
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Theo Chatzimichos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -80,6 +80,20 @@ dependencies:
|
|
80
80
|
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: semverse
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '2.0'
|
90
|
+
type: :runtime
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '2.0'
|
83
97
|
description: R10K and Puppetfile rake tasks
|
84
98
|
email:
|
85
99
|
- tampakrap@gmail.com
|
@@ -108,7 +122,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
108
122
|
requirements:
|
109
123
|
- - ">="
|
110
124
|
- !ruby/object:Gem::Version
|
111
|
-
version:
|
125
|
+
version: 2.1.0
|
112
126
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
113
127
|
requirements:
|
114
128
|
- - ">="
|
@@ -116,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
130
|
version: '0'
|
117
131
|
requirements: []
|
118
132
|
rubyforge_project:
|
119
|
-
rubygems_version: 2.
|
133
|
+
rubygems_version: 2.7.3
|
120
134
|
signing_key:
|
121
135
|
specification_version: 4
|
122
136
|
summary: Syntax check for the Puppetfile, check for outdated installed puppet modules
|