knife-spork 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +1 -1
- data/README.md +7 -0
- data/knife-spork.gemspec +1 -1
- data/lib/chef/knife/spork-bump.rb +7 -0
- data/lib/chef/knife/spork-databag-fromfile.rb +1 -1
- data/lib/chef/knife/spork-promote.rb +2 -2
- data/lib/knife-spork/runner.rb +1 -1
- metadata +7 -16
- data/.rvmrc +0 -1
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
YzVhYmQyOTBlMDQzMWNkNWY0ZDUwNTk4Njg3YjYyNDJjZDA0NjU1NA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OWM2M2VjYzg2MTUwNzM0YTkxN2M1ZGUzYjlmNTI4N2VlODk4N2Y0Nw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
MmNmYTkwODJhYmRkZjJiOTM0MmZkNmJhNzI1OWY4YTUwMGNkZDQxM2NjM2Y4
|
10
|
+
ZjVjNGYwMjliZjFkMjdmYjZiNWI0NjhhY2M5ZjllZTIzNjNjNDYzZTJmODNj
|
11
|
+
ZDYwMzQ1OGEzZTc1MWQ1N2YyZjhmZWY3MTA5NDg1MGI1ZjMwZjM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NTYzZWJiYjBjYmM0M2JmYzA3OGYxNmE5MTcxMGI3NDZhYzE4NDZkMjNmM2Ri
|
14
|
+
NDg1MzE4NWY1NGM1OWZlZjRhODhjNzEwOTQ5ZTAxNjlmOWYxNmNmODk5MjNj
|
15
|
+
ZTAzNTM1NWIzM2NjZGU3OGRjZWZjMjU1MDEzYzcxN2RkMDVjNmY=
|
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
knife-spork
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-1.9.3-p448
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
## 1.3.1 (31st Dec, 2013)
|
2
|
+
|
3
|
+
Features:
|
4
|
+
|
5
|
+
- Add a cookbook_path option to spork bump (https://github.com/jonlives/knife-spork/issues/92)
|
6
|
+
- Add config option to promote --remote by default (https://github.com/jonlives/knife-spork/issues/95)
|
7
|
+
|
8
|
+
Bugfixes:
|
9
|
+
|
10
|
+
- Fix issue with gist generation in the irccat plugin breaking when json diffs were incorrectly escaped ((https://github.com/jonlives/knife-spork/issues/97)
|
11
|
+
- Fix issue with data bag upload when file path is specified (https://github.com/jonlives/knife-spork/issues/98)
|
12
|
+
|
1
13
|
## 1.3.0 (23rd October, 2013)
|
2
14
|
|
3
15
|
Features:
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -2,6 +2,8 @@ KnifeSpork
|
|
2
2
|
===========
|
3
3
|
KnifeSpork is a workflow plugin for `Chef::Knife` which helps multiple developers work on the same Chef Server and repository without treading on each other's toes. This plugin was designed around the workflow we have here at Etsy, where several people are working on the Chef repository and Chef Server simultaneously. It contains several functions, documented below:
|
4
4
|
|
5
|
+
[![Gem Version](https://badge.fury.io/rb/knife-spork.png)](http://badge.fury.io/rb/knife-spork)
|
6
|
+
|
5
7
|
Installation
|
6
8
|
------------
|
7
9
|
|
@@ -48,6 +50,7 @@ version_change_threshold: 2
|
|
48
50
|
environment_path: "/home/me/environments"
|
49
51
|
role_path: "/home/me/roles"
|
50
52
|
custom_plugin_path: "/home/me/spork-plugins"
|
53
|
+
always_promote_remote: true
|
51
54
|
plugins:
|
52
55
|
campfire:
|
53
56
|
account: myaccount
|
@@ -93,6 +96,10 @@ The `environment_groups` directive allows you to specify a list of environments
|
|
93
96
|
#### Version Change Threshold
|
94
97
|
The `version_change_threshold` directive allows you to customise the threshold used by a safety check in spork promote which will prompt for confirmation if you're promoting a cookbook by more than version_change_threshold versions. This defaults to 2 if not set, ie promoting a cookbook from v1.0.1 to v 1.0.2 will not trip this check, wheras promoting from v1.0.1 to v1.0.3 will.
|
95
98
|
|
99
|
+
#### Always Promote Remote
|
100
|
+
The `always_promote_remote` directive allows you to tell spork promote to always act as if the --remote option had been specified. This will also have the same effect on spork omni. This option should only be used if you're sure you want all changes to be uploaded to the server as soon as you run promote.
|
101
|
+
|
102
|
+
|
96
103
|
#### Environment Path
|
97
104
|
The `environment_path` allows you to specify the path to where you store your chef environment json files. If this parameter is not specified, spork will default to using the first element of your cookbook_path, replacing the word "cookbooks" with "environments"
|
98
105
|
|
data/knife-spork.gemspec
CHANGED
@@ -2,7 +2,7 @@ $:.push File.expand_path('../lib', __FILE__)
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |gem|
|
4
4
|
gem.name = 'knife-spork'
|
5
|
-
gem.version = '1.3.
|
5
|
+
gem.version = '1.3.1'
|
6
6
|
gem.authors = ["Jon Cowie"]
|
7
7
|
gem.email = 'jonlives@gmail.com'
|
8
8
|
gem.homepage = 'https://github.com/jonlives/knife-spork'
|
@@ -7,10 +7,17 @@ module KnifeSpork
|
|
7
7
|
|
8
8
|
TYPE_INDEX = { :major => 0, :minor => 1, :patch => 2, :manual => 3 }.freeze
|
9
9
|
|
10
|
+
option :cookbook_path,
|
11
|
+
:short => '-o PATH:PATH',
|
12
|
+
:long => '--cookbook-path PATH:PATH',
|
13
|
+
:description => 'A colon-separated path to look for cookbooks in',
|
14
|
+
:proc => lambda { |o| o.split(':') }
|
15
|
+
|
10
16
|
banner 'knife spork bump COOKBOOK [major|minor|patch|manual]'
|
11
17
|
|
12
18
|
def run
|
13
19
|
self.config = Chef::Config.merge!(config)
|
20
|
+
config[:cookbook_path] ||= Chef::Config[:cookbook_path]
|
14
21
|
|
15
22
|
if @name_args.empty?
|
16
23
|
show_usage
|
@@ -54,7 +54,7 @@ module KnifeSpork
|
|
54
54
|
|
55
55
|
else
|
56
56
|
@name_args[1..-1].each do |arg|
|
57
|
-
@object_secondary_name = arg
|
57
|
+
@object_secondary_name = arg.split("/").last
|
58
58
|
run_plugins(:before_databagfromfile)
|
59
59
|
begin
|
60
60
|
pre_databag = load_databag_item(@object_name, @object_secondary_name.gsub(".json",""))
|
@@ -61,7 +61,7 @@ module KnifeSpork
|
|
61
61
|
new_environment_json = pretty_print_json(environment.to_hash)
|
62
62
|
save_environment_changes(e, new_environment_json)
|
63
63
|
|
64
|
-
if config[:remote]
|
64
|
+
if config[:remote] || spork_config.always_promote_remote
|
65
65
|
ui.msg "Uploading #{environment.name}.json to Chef Server"
|
66
66
|
save_environment_changes_remote(e)
|
67
67
|
ui.info "Promotion complete at #{Time.now}!"
|
@@ -70,7 +70,7 @@ module KnifeSpork
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
run_plugins(:after_promote_local)
|
73
|
-
if config[:remote]
|
73
|
+
if config[:remote] || spork_config.always_promote_remote
|
74
74
|
run_plugins(:after_promote_remote)
|
75
75
|
end
|
76
76
|
end
|
data/lib/knife-spork/runner.rb
CHANGED
@@ -211,7 +211,7 @@ module KnifeSpork
|
|
211
211
|
def json_diff(a, b)
|
212
212
|
pre_json = JSON.parse(a.respond_to?(:to_json) ? a.to_json : a)
|
213
213
|
post_json = JSON.parse(b.respond_to?(:to_json) ? b.to_json : b)
|
214
|
-
Diffy::Diff.new(JSON.pretty_generate(pre_json), JSON.pretty_generate(post_json), :diff=>"-U 3")
|
214
|
+
Diffy::Diff.new(JSON.pretty_generate(pre_json), JSON.pretty_generate(post_json), :diff=>"-U 3").to_s.gsub(/[()]/, '\\\\\0')
|
215
215
|
end
|
216
216
|
|
217
217
|
def hash_diff(hash, other)
|
metadata
CHANGED
@@ -1,20 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: knife-spork
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
5
|
-
prerelease:
|
4
|
+
version: 1.3.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Jon Cowie
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-12-31 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: chef
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
17
|
- - ! '>='
|
20
18
|
- !ruby/object:Gem::Version
|
@@ -22,7 +20,6 @@ dependencies:
|
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
24
|
- - ! '>='
|
28
25
|
- !ruby/object:Gem::Version
|
@@ -30,7 +27,6 @@ dependencies:
|
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: git
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
31
|
- - ! '>='
|
36
32
|
- !ruby/object:Gem::Version
|
@@ -38,7 +34,6 @@ dependencies:
|
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
38
|
- - ! '>='
|
44
39
|
- !ruby/object:Gem::Version
|
@@ -46,7 +41,6 @@ dependencies:
|
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: app_conf
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
45
|
- - ! '>='
|
52
46
|
- !ruby/object:Gem::Version
|
@@ -54,7 +48,6 @@ dependencies:
|
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
52
|
- - ! '>='
|
60
53
|
- !ruby/object:Gem::Version
|
@@ -62,7 +55,6 @@ dependencies:
|
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: diffy
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
59
|
- - ! '>='
|
68
60
|
- !ruby/object:Gem::Version
|
@@ -70,7 +62,6 @@ dependencies:
|
|
70
62
|
type: :runtime
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
66
|
- - ! '>='
|
76
67
|
- !ruby/object:Gem::Version
|
@@ -82,7 +73,8 @@ extensions: []
|
|
82
73
|
extra_rdoc_files: []
|
83
74
|
files:
|
84
75
|
- .gitignore
|
85
|
-
- .
|
76
|
+
- .ruby-gemset
|
77
|
+
- .ruby-version
|
86
78
|
- CHANGELOG.md
|
87
79
|
- Gemfile
|
88
80
|
- LICENSE
|
@@ -138,26 +130,25 @@ files:
|
|
138
130
|
- plugins/Template.md
|
139
131
|
homepage: https://github.com/jonlives/knife-spork
|
140
132
|
licenses: []
|
133
|
+
metadata: {}
|
141
134
|
post_install_message:
|
142
135
|
rdoc_options: []
|
143
136
|
require_paths:
|
144
137
|
- lib
|
145
138
|
required_ruby_version: !ruby/object:Gem::Requirement
|
146
|
-
none: false
|
147
139
|
requirements:
|
148
140
|
- - ! '>='
|
149
141
|
- !ruby/object:Gem::Version
|
150
142
|
version: '0'
|
151
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
|
-
none: false
|
153
144
|
requirements:
|
154
145
|
- - ! '>='
|
155
146
|
- !ruby/object:Gem::Version
|
156
147
|
version: '0'
|
157
148
|
requirements: []
|
158
149
|
rubyforge_project:
|
159
|
-
rubygems_version: 1.
|
150
|
+
rubygems_version: 2.1.10
|
160
151
|
signing_key:
|
161
|
-
specification_version:
|
152
|
+
specification_version: 4
|
162
153
|
summary: A workflow plugin to help many devs work with the same chef repo/server
|
163
154
|
test_files: []
|
data/.rvmrc
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
rvm use 1.9.3@knife-spork --create
|