modulesync 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +10 -0
- data/README.md +1 -1
- data/features/step_definitions/git_steps.rb +2 -2
- data/features/update.feature +26 -0
- data/lib/modulesync.rb +2 -2
- data/lib/modulesync/git.rb +4 -4
- data/lib/modulesync/hook.rb +2 -2
- data/modulesync.gemspec +2 -4
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9799ba2b483f6370a71e6787b21862cf6aeab0246f1b7896be48175c37564db3
|
4
|
+
data.tar.gz: fccd8279e58613ac070d05175bce1a9b0f4afc292ffac78c347f343518434bc3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4f4e927a0d4df8a95859c23319cb395f3418ecd0fa4dadc5c9a68209dcc767bc821b71dd2206fa4b6c482a65464940803a2958849cd1a991276342490356351
|
7
|
+
data.tar.gz: c5cee9698af0bea865f69f5bed772db3a881e339e7a6626c6be70968c02568de8a5899c3dcebc3cfc3620f66fe51a65fa1b6887f2d929ac56bdf66a5dab59a82
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 2017-11-03 - 0.8.2
|
4
|
+
|
5
|
+
### Summary
|
6
|
+
|
7
|
+
This release fixes:
|
8
|
+
* Bug that caused .gitignore file handle to be left open - [#131](https://github.com/voxpupuli/modulesync/pull/131).
|
9
|
+
* Fixed switch_branch to use current_branch instead of master - [#130](https://github.com/voxpupuli/modulesync/pull/130).
|
10
|
+
* Fixed bug where failed runs wouldn't return correct exit code - [#125](https://github.com/voxpupuli/modulesync/pull/125).
|
11
|
+
* Fix typo in README link to Voxpupuli modulesync_config [#123](https://github.com/voxpupuli/modulesync/pull/123).
|
12
|
+
|
3
13
|
## 2017-05-08 - 0.8.1
|
4
14
|
|
5
15
|
### Summary
|
data/README.md
CHANGED
@@ -363,5 +363,5 @@ As commented, files within moduleroot directory can be flat files or ERB templat
|
|
363
363
|
The Templates
|
364
364
|
-------------
|
365
365
|
|
366
|
-
See [Puppet's modulesync\_configs](https://github.com/puppetlabs/modulesync_configs) and [Vox Pupuli's modulesync\
|
366
|
+
See [Puppet's modulesync\_configs](https://github.com/puppetlabs/modulesync_configs) and [Vox Pupuli's modulesync\_config](https://github.com/voxpupuli/modulesync_config)
|
367
367
|
repositories for different templates currently in use.
|
data/features/update.feature
CHANGED
@@ -34,6 +34,32 @@ Feature: update
|
|
34
34
|
Given I run `cat modules/puppet-test/test`
|
35
35
|
Then the output should contain "aruba"
|
36
36
|
|
37
|
+
Scenario: Adding a new file to repo without write access
|
38
|
+
Given a file named "managed_modules.yml" with:
|
39
|
+
"""
|
40
|
+
---
|
41
|
+
- puppet-test
|
42
|
+
"""
|
43
|
+
And a file named "modulesync.yml" with:
|
44
|
+
"""
|
45
|
+
---
|
46
|
+
namespace: maestrodev
|
47
|
+
git_base: git@github.com:
|
48
|
+
"""
|
49
|
+
And a file named "config_defaults.yml" with:
|
50
|
+
"""
|
51
|
+
---
|
52
|
+
test:
|
53
|
+
name: aruba
|
54
|
+
"""
|
55
|
+
And a directory named "moduleroot"
|
56
|
+
And a file named "moduleroot/test.erb" with:
|
57
|
+
"""
|
58
|
+
<%= @configs['name'] %>
|
59
|
+
"""
|
60
|
+
When I run `msync update -m "Add test" -r`
|
61
|
+
Then the exit status should be 1
|
62
|
+
|
37
63
|
Scenario: Adding a new file, without the .erb suffix
|
38
64
|
Given a file named "managed_modules.yml" with:
|
39
65
|
"""
|
data/lib/modulesync.rb
CHANGED
@@ -81,7 +81,7 @@ module ModuleSync
|
|
81
81
|
erb = Renderer.build(templatename)
|
82
82
|
template = Renderer.render(erb, configs)
|
83
83
|
Renderer.sync(template, module_file(options[:project_root], module_name, filename))
|
84
|
-
rescue
|
84
|
+
rescue # rubocop:disable Lint/RescueWithoutErrorClass
|
85
85
|
STDERR.puts "Error while rendering #{filename}"
|
86
86
|
raise
|
87
87
|
end
|
@@ -132,7 +132,7 @@ module ModuleSync
|
|
132
132
|
managed_modules.each do |puppet_module, module_options|
|
133
133
|
begin
|
134
134
|
manage_module(puppet_module, module_files, module_options, defaults, options)
|
135
|
-
rescue
|
135
|
+
rescue # rubocop:disable Lint/RescueWithoutErrorClass
|
136
136
|
STDERR.puts "Error while updating #{puppet_module}"
|
137
137
|
raise unless options[:skip_broken]
|
138
138
|
puts "Skipping #{puppet_module} as update process failed"
|
data/lib/modulesync/git.rb
CHANGED
@@ -19,7 +19,7 @@ module ModuleSync
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def self.switch_branch(repo, branch)
|
22
|
-
return if repo.
|
22
|
+
return if repo.current_branch == branch
|
23
23
|
|
24
24
|
if local_branch_exists?(repo, branch)
|
25
25
|
puts "Switching to branch #{branch}"
|
@@ -136,7 +136,7 @@ module ModuleSync
|
|
136
136
|
puts "There were no files to update in #{name}. Not committing."
|
137
137
|
else
|
138
138
|
puts git_error
|
139
|
-
exit
|
139
|
+
exit(1)
|
140
140
|
end
|
141
141
|
end
|
142
142
|
end
|
@@ -146,7 +146,7 @@ module ModuleSync
|
|
146
146
|
# https://github.com/schacon/ruby-git/issues/130
|
147
147
|
def self.untracked_unignored_files(repo)
|
148
148
|
ignore_path = "#{repo.dir.path}/.gitignore"
|
149
|
-
ignored = File.exist?(ignore_path) ? File.
|
149
|
+
ignored = File.exist?(ignore_path) ? File.read(ignore_path).split : []
|
150
150
|
repo.status.untracked.keep_if { |f, _| ignored.none? { |i| File.fnmatch(i, f) } }
|
151
151
|
end
|
152
152
|
|
@@ -162,7 +162,7 @@ module ModuleSync
|
|
162
162
|
end
|
163
163
|
|
164
164
|
puts 'Files added:'
|
165
|
-
untracked_unignored_files(repo).
|
165
|
+
untracked_unignored_files(repo).each_key do |file|
|
166
166
|
puts file
|
167
167
|
end
|
168
168
|
|
data/lib/modulesync/hook.rb
CHANGED
@@ -12,14 +12,14 @@ module ModuleSync
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def content(arguments)
|
15
|
-
<<-
|
15
|
+
<<-CONTENT
|
16
16
|
#!/usr/bin/env bash
|
17
17
|
|
18
18
|
current_branch=\`git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,'\`
|
19
19
|
git_dir=\`git rev-parse --show-toplevel\`
|
20
20
|
message=\`git log -1 --format=%B\`
|
21
21
|
msync -m "\$message" #{arguments}
|
22
|
-
|
22
|
+
CONTENT
|
23
23
|
end
|
24
24
|
|
25
25
|
def activate
|
data/modulesync.gemspec
CHANGED
@@ -1,11 +1,9 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
1
|
lib = File.expand_path('../lib', __FILE__)
|
4
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
3
|
|
6
4
|
Gem::Specification.new do |spec|
|
7
5
|
spec.name = 'modulesync'
|
8
|
-
spec.version = '0.8.
|
6
|
+
spec.version = '0.8.2'
|
9
7
|
spec.authors = ['Vox Pupuli']
|
10
8
|
spec.email = ['voxpupuli@groups.io']
|
11
9
|
spec.summary = 'Puppet Module Synchronizer'
|
@@ -23,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
23
21
|
spec.add_development_dependency 'bundler'
|
24
22
|
spec.add_development_dependency 'rake'
|
25
23
|
spec.add_development_dependency 'rspec'
|
26
|
-
spec.add_development_dependency 'rubocop'
|
24
|
+
spec.add_development_dependency 'rubocop', '~> 0.50.0'
|
27
25
|
|
28
26
|
spec.add_runtime_dependency 'git', '~>1.3'
|
29
27
|
spec.add_runtime_dependency 'puppet-blacksmith', '~>3.0'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modulesync
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|
@@ -70,16 +70,16 @@ dependencies:
|
|
70
70
|
name: rubocop
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version:
|
75
|
+
version: 0.50.0
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version:
|
82
|
+
version: 0.50.0
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: git
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
179
179
|
version: '0'
|
180
180
|
requirements: []
|
181
181
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.
|
182
|
+
rubygems_version: 2.7.2
|
183
183
|
signing_key:
|
184
184
|
specification_version: 4
|
185
185
|
summary: Puppet Module Synchronizer
|