modulesync 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ##2015-06-24 - 0.4.0
2
+
3
+ ### Summary
4
+
5
+ This release adds a --remote-branch flag and adds a global key for template
6
+ config.
7
+
8
+ #### Features
9
+
10
+ - Expose --remote-branch
11
+ - Add a global config key
12
+
13
+ #### Bugfixes
14
+
15
+ - Fix markdown syntax in README
16
+
1
17
  ##2015-03-12 - 0.3.0
2
18
 
3
19
  ### Summary
data/README.md CHANGED
@@ -67,6 +67,9 @@ overridden or extended by adding a file called .sync.yml to the module itself.
67
67
  This allows us to, for example, have a set of "required" gems that are added
68
68
  to all Gemfiles, and a set of "optional" gems that a single module might add.
69
69
 
70
+ Within the templates, values can be accessed in the `@configs` hash, which is
71
+ merged from the values under the keys `:global` and the current file name.
72
+
70
73
  The list of modules to manage is in managed\_modules.yml in the configuration
71
74
  directory. This lists just the names of the modules to be managed.
72
75
 
@@ -115,7 +118,7 @@ but does not commit or push changes. It is still destructive in that it
115
118
  overwrites local changes.
116
119
 
117
120
  ```
118
- msync update --noop
121
+ msync update --noop
119
122
  ```
120
123
 
121
124
  #### Damage mode
@@ -236,6 +239,7 @@ branch: modulesyncbranch
236
239
  git_base: 'user@gitlab.example.com:'
237
240
  namespace: MySuperOrganization
238
241
  branch: modulesyncbranch
242
+ ```
239
243
 
240
244
  ###### Gerrit
241
245
 
@@ -256,6 +260,15 @@ If you only want to sync some of the repositories in your managed_modules.yml, u
256
260
  msync update -f augeas -m "Commit message"
257
261
  msync update -f puppet-a..o "Commit message"
258
262
  ```
263
+
264
+ #### Pushing to a different remote branch
265
+
266
+ If you want to push the modified branch to a different remote branch, you can use the -r flag:
267
+
268
+ ```
269
+ msync update -r master_new -m "Commit message"
270
+ ```
271
+
259
272
  #### Automating updates
260
273
 
261
274
  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] [--bump] [--changelog] [--tag] [--tag-pattern <tag_pattern>] [-n <namespace>] [-b <branch>] [-f <filter>] | hook activate|deactivate [-c <directory> ] [-n <namespace>] [-b <branch>]"
38
+ opts.banner = "Usage: msync update [-m <commit message>] [-c <directory> ] [--noop] [--bump] [--changelog] [--tag] [--tag-pattern <tag_pattern>] [-n <namespace>] [-b <branch>] [-r <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('-r', '--remote-branch <branch>',
56
+ 'Remote branch name to push the changes to. Defaults to the branch name') do |branch|
57
+ @options[:remote_branch] = branch
58
+ end
55
59
  opts.on('-f', '--filter <filter>',
56
60
  'A regular expression to filter repositories to update.') do |filter|
57
61
  @options[:filter] = filter
@@ -6,5 +6,6 @@ module ModuleSync
6
6
  MODULESYNC_CONF_FILE = 'modulesync.yml'
7
7
  PROJ_ROOT = './modules'
8
8
  HOOK_FILE = '.git/hooks/pre-push'
9
+ GLOBAL_DEFAULTS_KEY = :global
9
10
  end
10
11
  end
data/lib/modulesync.rb CHANGED
@@ -59,10 +59,12 @@ module ModuleSync
59
59
  git_base = "#{options[:git_base]}#{options[:namespace]}"
60
60
  Git.pull(git_base, puppet_module, options[:branch], opts || {})
61
61
  module_configs = Util.parse_config("#{PROJ_ROOT}/#{puppet_module}/#{MODULE_CONF_FILE}")
62
- files_to_manage = module_files | defaults.keys | module_configs.keys
62
+ global_defaults = defaults[GLOBAL_DEFAULTS_KEY] || {}
63
+ module_defaults = module_configs[GLOBAL_DEFAULTS_KEY] || {}
64
+ files_to_manage = (module_files | defaults.keys | module_configs.keys) - [GLOBAL_DEFAULTS_KEY]
63
65
  files_to_delete = []
64
66
  files_to_manage.each do |file|
65
- file_configs = (defaults[file] || {}).merge(module_configs[file] || {})
67
+ file_configs = global_defaults.merge(defaults[file] || {}).merge(module_defaults).merge(module_configs[file] || {})
66
68
  file_configs[:puppet_module] = puppet_module
67
69
  if file_configs['unmanaged']
68
70
  puts "Not managing #{file} in #{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.3.0'
7
+ spec.version = '0.4.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,18 +1,20 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: modulesync
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Colleen Murphy
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2015-03-13 00:00:00.000000000 Z
12
+ date: 2015-06-24 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: bundler
15
16
  requirement: !ruby/object:Gem::Requirement
17
+ none: false
16
18
  requirements:
17
19
  - - ~>
18
20
  - !ruby/object:Gem::Version
@@ -20,6 +22,7 @@ dependencies:
20
22
  type: :development
21
23
  prerelease: false
22
24
  version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
23
26
  requirements:
24
27
  - - ~>
25
28
  - !ruby/object:Gem::Version
@@ -27,6 +30,7 @@ dependencies:
27
30
  - !ruby/object:Gem::Dependency
28
31
  name: git
29
32
  requirement: !ruby/object:Gem::Requirement
33
+ none: false
30
34
  requirements:
31
35
  - - ~>
32
36
  - !ruby/object:Gem::Version
@@ -34,6 +38,7 @@ dependencies:
34
38
  type: :runtime
35
39
  prerelease: false
36
40
  version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
37
42
  requirements:
38
43
  - - ~>
39
44
  - !ruby/object:Gem::Version
@@ -41,6 +46,7 @@ dependencies:
41
46
  - !ruby/object:Gem::Dependency
42
47
  name: puppet-blacksmith
43
48
  requirement: !ruby/object:Gem::Requirement
49
+ none: false
44
50
  requirements:
45
51
  - - ~>
46
52
  - !ruby/object:Gem::Version
@@ -48,6 +54,7 @@ dependencies:
48
54
  type: :runtime
49
55
  prerelease: false
50
56
  version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
51
58
  requirements:
52
59
  - - ~>
53
60
  - !ruby/object:Gem::Version
@@ -78,25 +85,26 @@ files:
78
85
  homepage: http://github.com/puppetlabs/modulesync
79
86
  licenses:
80
87
  - Apache 2
81
- metadata: {}
82
88
  post_install_message:
83
89
  rdoc_options: []
84
90
  require_paths:
85
91
  - lib
86
92
  required_ruby_version: !ruby/object:Gem::Requirement
93
+ none: false
87
94
  requirements:
88
- - - '>='
95
+ - - ! '>='
89
96
  - !ruby/object:Gem::Version
90
97
  version: '0'
91
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
+ none: false
92
100
  requirements:
93
- - - '>='
101
+ - - ! '>='
94
102
  - !ruby/object:Gem::Version
95
103
  version: '0'
96
104
  requirements: []
97
105
  rubyforge_project:
98
- rubygems_version: 2.0.14
106
+ rubygems_version: 1.8.23
99
107
  signing_key:
100
- specification_version: 4
108
+ specification_version: 3
101
109
  summary: Puppet Module Synchronizer
102
110
  test_files: []
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: bcd0fbe76e6f665fb7122e17a5d6945f7be84bbe
4
- data.tar.gz: 5f4e45bc2b44d51fb2b215d022e2269712f47a24
5
- SHA512:
6
- metadata.gz: 150e69be961f2c98a69dd1e7f0469a67337991d01ca66279c61ecdfb63f41fd049682b1f4bafe16dbe5d808a4a3786cb7626ede3b82528c2276d686c9bf5f362
7
- data.tar.gz: 326c5d4551c5398f22e635149b9cec5bf09f61047e198cb761910a13ba947cc4dffdd997ca12b14a0b53bd8704f25a4634f07fe6d18d8f33dcd0bcd9b30be5a3