puppetfile-updater 0.4.1 → 0.5.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 +4 -4
- data/augeas/lenses/puppetfile.aug +23 -10
- data/lib/puppetfile-updater/task.rb +18 -15
- metadata +5 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60e02e6b035bd9810d8292e50b3c4213ec687fdf0d6a7c9848bcec3141de7329
|
4
|
+
data.tar.gz: aa8c8182320447b00dabad5a20e35b96f53432690379de0a91012dfdf6fa9340
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c2f1b4504a1c3aaa5b49df475014539f631fc2444314120819b76ca80c967149c760ed0b57b108a92a3359e0d4c846fadf05862f86480d20be1162ea46849d0
|
7
|
+
data.tar.gz: 3a1b9add9a9d2bd8f072cafcb56d62ba4e34e22a9624b1555adf9ab511a84c5abd1b48fca37aa22919ad382ac29f095982991764bb1dd69dcd2dd2908c0230b9
|
@@ -25,31 +25,44 @@ module Puppetfile =
|
|
25
25
|
(* View: comma
|
26
26
|
a comma, optionally preceded or followed by spaces or newlines *)
|
27
27
|
let comma = del /[ \t\n]*,[ \t\n]*/ ", "
|
28
|
+
let comma_nospace = del /[ \t\n]*,/ ","
|
29
|
+
|
30
|
+
let comment_or_eol = Util.eol | Util.comment_eol
|
31
|
+
let quote_to_comment_or_eol = Quote.do_quote (store /[^#\n]*/) . comment_or_eol
|
28
32
|
|
29
33
|
(* View: moduledir
|
30
34
|
The moduledir setting specifies where modules from the Puppetfile will be installed *)
|
31
|
-
let moduledir = [ Util.indent . key "moduledir" . Sep.space
|
35
|
+
let moduledir = [ Util.indent . key "moduledir" . Sep.space
|
36
|
+
. quote_to_comment_or_eol ]
|
32
37
|
|
33
38
|
(* View: forge
|
34
39
|
a forge entry *)
|
35
|
-
let forge = [ Util.indent . key "forge" . Sep.space
|
40
|
+
let forge = [ Util.indent . key "forge" . Sep.space
|
41
|
+
. quote_to_comment_or_eol ]
|
36
42
|
|
37
43
|
(* View: metadata
|
38
44
|
a metadata entry *)
|
39
|
-
let metadata = [ Util.indent . key "metadata" .
|
45
|
+
let metadata = [ Util.indent . key "metadata" . comment_or_eol ]
|
40
46
|
|
41
47
|
(* View: mod
|
42
48
|
a module entry, with optional version and options *)
|
43
49
|
let mod =
|
44
50
|
let mod_name = Quote.do_quote (store ((Rx.word . /[\/-]/)? . Rx.word))
|
45
|
-
in let version = [ label "@version" . Quote.do_quote (store /[
|
46
|
-
in let
|
47
|
-
|
48
|
-
|
51
|
+
in let version = [ label "@version" . Quote.do_quote (store /[^#:\n]+/) . Util.comment_eol? ]
|
52
|
+
in let sto_opt_val = store /[^#"', \t\n][^#"',\n]*[^#"', \t\n]|[^#"', \t\n]/
|
53
|
+
in let opt = [
|
54
|
+
Util.del_str ":" . key Rx.word
|
55
|
+
. (del /[ \t]*=>[ \t]*/ " => " . Quote.do_quote_opt sto_opt_val)?
|
56
|
+
]
|
57
|
+
in let opt_eol = del /([ \t\n]*\n)?/ ""
|
58
|
+
in let opt_space_or_eol = del /[ \t\n]*/ " "
|
59
|
+
in let comma_opt_eol_comment = comma_nospace . (opt_eol . Util.comment_eol)*
|
60
|
+
. opt_space_or_eol
|
61
|
+
in let opts = Build.opt_list opt comma_opt_eol_comment
|
49
62
|
in [ Util.indent . Util.del_str "mod" . seq "mod" . Sep.space . mod_name
|
50
|
-
. (
|
51
|
-
. (
|
52
|
-
. Util.eol ]
|
63
|
+
. (comma_opt_eol_comment . version)?
|
64
|
+
. (comma_opt_eol_comment . opts . Util.comment_eol?)?
|
65
|
+
. Util.eol ]
|
53
66
|
|
54
67
|
(* View: lns
|
55
68
|
the Puppetfile lens *)
|
@@ -14,6 +14,7 @@ class PuppetfileUpdater
|
|
14
14
|
attr_accessor :user
|
15
15
|
attr_accessor :module
|
16
16
|
attr_accessor :major
|
17
|
+
attr_accessor :skip_git
|
17
18
|
attr_accessor :gh_login
|
18
19
|
attr_accessor :gh_password
|
19
20
|
attr_accessor :debug
|
@@ -69,21 +70,23 @@ class PuppetfileUpdater
|
|
69
70
|
abort msg
|
70
71
|
end
|
71
72
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
73
|
+
unless @skip_git
|
74
|
+
# Update from GitHub
|
75
|
+
aug.match("/files/Puppetfile/*[git=~regexp('.*/#{@user}[/-].*')]").each do |mpath|
|
76
|
+
m = aug.get(mpath)
|
77
|
+
puts "D: Considering #{m} for git update" if @debug
|
78
|
+
next if !@module.nil? && @module != m.gsub(%r{.*[-/]}, '')
|
79
|
+
puts "D: #{m} selected by filters" if @debug
|
80
|
+
|
81
|
+
warn "W: #{m} is a fork!" unless m =~ /#{@user}/
|
82
|
+
|
83
|
+
git_url = aug.get("#{mpath}/git")
|
84
|
+
repo = Octokit::Repository.from_url(git_url.gsub(/\.git$/, ''))
|
85
|
+
commits = github.commits(repo)
|
86
|
+
ref = commits[0].sha[0...7]
|
87
|
+
puts "D: New ref for #{m} is #{ref}" if @debug
|
88
|
+
aug.set("#{mpath}/ref", ref)
|
89
|
+
end
|
87
90
|
end
|
88
91
|
|
89
92
|
# Update from Forge
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppetfile-updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camptocamp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -66,8 +66,8 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
description:
|
70
|
-
|
69
|
+
description: " Keep your Puppet file up-to-date with latest versions from the Forge
|
70
|
+
and GitHub.\n"
|
71
71
|
email: raphael.pinson@camptocamp.com
|
72
72
|
executables: []
|
73
73
|
extensions: []
|
@@ -96,8 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
|
100
|
-
rubygems_version: 2.7.7
|
99
|
+
rubygems_version: 3.0.3
|
101
100
|
signing_key:
|
102
101
|
specification_version: 4
|
103
102
|
summary: Keep your Puppetfile up-to-date.
|