modulesync 0.1.0 → 0.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 38b2eb4843e2a132da91b2bde013d8d648e6c007
4
- data.tar.gz: 3d54efb0292a807e4f2b556662025884a855c4da
3
+ metadata.gz: 6c1dc855f2c78b421ce564326e848cb4622b887c
4
+ data.tar.gz: 6b9ea713d13af6cb4c079069a7e0883c7531ad52
5
5
  SHA512:
6
- metadata.gz: 7cb07104d0f07b006cde792d4b73d31a23f4a1c88024887bddb6f4e5408b9d99243665f99ba4beae40037c16b63a3f735a78138a8e424f75ad822684f225f527
7
- data.tar.gz: 3aabccaa9cd274721fdefdea44b40ccf6a3acda3cb8ad603a16d3dc366df4c5596b45f565e25719c36b6ecfb0c287911e68b44026a81d16e20b6cb7346fc3d48
6
+ metadata.gz: 6835740e963f045ec525312d2fa208eac048d9277af16699b7a5cf605eef4bf8c99b8f5eb522492b17d489905b49a7fa7a249f58f68b2e4a9e264d0da6936687
7
+ data.tar.gz: 93e83428fbc900e1e72889b6a1af73c20d41a35dfdd441575e17d5576a997a244cf7747e94e6d95756c292cf7511d063c63206daad4b75773a76699ec7f14fd7
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ##2014-11-16 - 0.2.0
2
+
3
+ ### Summary
4
+
5
+ This release adds the --filter flag to filter what modules to sync.
6
+ Also fixes the README to document the very important -m flag.
7
+
1
8
  ##2014-9-29 - 0.1.0
2
9
 
3
10
  ### Summary
data/README.md CHANGED
@@ -127,7 +127,7 @@ pre-cloned modules from the dry-run or clones them fresh if the modules aren't
127
127
  found.
128
128
 
129
129
  ```
130
- msync update
130
+ msync update -m "Commit message"
131
131
  ```
132
132
 
133
133
  #### Automating Updates
@@ -177,7 +177,7 @@ namespace if the modules are not pre-cloned. You need to specify a branch to
177
177
  push to if you are not pushing to master.
178
178
 
179
179
  ```
180
- msync update -n git@github.com:puppetlabs -b sync_branch
180
+ msync update -n git@github.com:puppetlabs -b sync_branch -m "Commit message"
181
181
  ```
182
182
 
183
183
  #### Configuring ModuleSync defaults
@@ -198,9 +198,17 @@ Then you can run ModuleSync without extra arguments:
198
198
 
199
199
  ```
200
200
  msync update --noop
201
- msync update
201
+ msync update -m "Commit message"
202
202
  ```
203
203
 
204
+ #### Filtering Repositories
205
+
206
+ If you only want to sync some of the repositories in your managed_modules.yml, use the -f flag to filter by a regex:
207
+
208
+ ```
209
+ msync update -f augeas -m "Commit message"
210
+ msync update -f puppet-a..o "Commit message"
211
+ ```
204
212
  #### Automating updates
205
213
 
206
214
  If you install a git hook, you need to tell it what remote and branch to push
@@ -35,7 +35,7 @@ module ModuleSync
35
35
  @options.merge!(Hash.transform_keys_to_symbols(Util.parse_config(MODULESYNC_CONF_FILE)))
36
36
  @options[:command] = args[0] if commands_available.include?(args[0])
37
37
  opt_parser = OptionParser.new do |opts|
38
- opts.banner = "Usage: msync update [-m <commit message>] [-c <directory> ] [--noop] [-n <namespace>] [-b <branch>] | hook activate|deactivate [-c <directory> ] [-n <namespace>] [-b <branch>]"
38
+ opts.banner = "Usage: msync update [-m <commit message>] [-c <directory> ] [--noop] [-n <namespace>] [-b <branch>] [-f <filter>] | hook activate|deactivate [-c <directory> ] [-n <namespace>] [-b <branch>]"
39
39
  opts.on('-m', '--message <msg>',
40
40
  'Commit message to apply to updated modules') do |msg|
41
41
  @options[:message] = msg
@@ -52,6 +52,10 @@ module ModuleSync
52
52
  'Branch name to make the changes in. Defaults to "master"') do |branch|
53
53
  @options[:branch] = branch
54
54
  end
55
+ opts.on('-f', '--filter <filter>',
56
+ 'A regular expression to filter repositories to update.') do |filter|
57
+ @options[:filter] = filter
58
+ end
55
59
  opts.on('--noop',
56
60
  'No-op mode') do |msg|
57
61
  @options[:noop] = true
data/lib/modulesync.rb CHANGED
@@ -30,12 +30,13 @@ module ModuleSync
30
30
  local_files.map { |file| file.sub(/#{path}/, '') }
31
31
  end
32
32
 
33
- def self.managed_modules(path)
33
+ def self.managed_modules(path, filter)
34
34
  managed_modules = Util.parse_config(path)
35
35
  if managed_modules.empty?
36
36
  puts "No modules found at #{path}. Check that you specified the right configs directory containing managed_modules.yml."
37
37
  exit
38
38
  end
39
+ managed_modules.select! { |m| m =~ Regexp.new(filter) } unless filter.nil?
39
40
  managed_modules
40
41
  end
41
42
 
@@ -50,7 +51,7 @@ module ModuleSync
50
51
  local_files = self.local_files(path)
51
52
  module_files = self.module_files(local_files, path)
52
53
 
53
- managed_modules = self.managed_modules("#{options[:configs]}/managed_modules.yml")
54
+ managed_modules = self.managed_modules("#{options[:configs]}/managed_modules.yml", options[:filter])
54
55
 
55
56
  managed_modules.each do |puppet_module|
56
57
  puts "Syncing #{puppet_module}"
data/modulesync.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'modulesync'
7
- spec.version = '0.1.0'
7
+ spec.version = '0.2.0'
8
8
  spec.authors = ['Colleen Murphy']
9
9
  spec.email = ['colleen@puppetlabs.com']
10
10
  spec.summary = %q{Puppet Module Synchronizer}
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.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Colleen Murphy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-29 00:00:00.000000000 Z
11
+ date: 2014-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler