knife-spork 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md ADDED
@@ -0,0 +1,99 @@
1
+ ## 0.1.11 (5th June, 2012)
2
+ Features:
3
+
4
+ - Hipchat Support (courtesy of Chris Ferry: @cdferry)
5
+
6
+ Bugfixes:
7
+
8
+ - Tweaks to spork bump to play nicely with x.x versions as well as x.x.x (courtesy of Russ Garrett: @russss)
9
+
10
+ ## 0.1.10 (12th April, 2012)
11
+ Features:
12
+
13
+ - All spork plugins now support multiple cookbook paths
14
+
15
+ Bugfixes:
16
+
17
+ - Fixes to work with app_conf 0.4.0
18
+
19
+ ## 0.1.9 (3rd April, 2012)
20
+
21
+ Features:
22
+
23
+ - Spork Promote will now git add updated environment files if git is enabled
24
+ - Spork Promote will optionally revert local changes to environment files if multiple changes were detected.
25
+ - Spork Bump will now perform a git pull and pull from submodules if git is enabled
26
+ - Optional Foodcritic integration added for Spork Upload
27
+ - ickymettle's Eventinator service now optionally supported
28
+
29
+ Bugfixes:
30
+
31
+ - Correct irccat alerts to not fire if cookbook upload fails
32
+ - Code cleanup to remove unused Opscode code from Spork Upload
33
+
34
+ ## 0.1.8 (21st February, 2012)
35
+
36
+ Features:
37
+
38
+ - Make promote --remote check if the correct version of the cookbook has been uploaded before updating the remote environment
39
+
40
+ ## 0.1.7 (21st February, 2012)
41
+
42
+ Bugfixes:
43
+
44
+ - Make promote --remote work nicely when not run from chef repo root
45
+
46
+ ## 0.1.6 (21st February, 2012)
47
+ Features:
48
+
49
+ - Spork Bump now defaults to "patch" if bump level not specified
50
+ - Spork Promote will prompt for confirmation if you're about to promote --remote changes to any cookbooks *other* than the one you specified on the command line. This should help avoid accidentally over-writing someone elses changes.
51
+ - Irccat messages now support multiple channels
52
+ - During promote, if git pull fails, ie a merge conflict has arisen, the error will be shown and promote will exit.
53
+ - Spork Promote will now also update git submodules before promoting. Specifically, it will run "git submodule foreach git pull"
54
+ - Failures during "git add" on spork bumps have a more helpful error message
55
+ - Irccat messages are now more nicely formatted and have pretty colours.
56
+
57
+ Bugfixes:
58
+
59
+ - Spork Promote will now work from anywhere in your chef repo, not just the repo root
60
+
61
+ ## 0.1.5 (21st February, 2012)
62
+
63
+ Yanked
64
+
65
+ ## 0.1.4 (3rd February, 2012)
66
+
67
+ Features:
68
+
69
+ - Spork Check only show the last 5 remote versions, include the --all option if you want to see them all
70
+ - Spork will no longer work with Ruby 1.8. If you're on that version, the plugin will bail immediately.
71
+ - Spork now support updating a graphite metric when promote --remote is run
72
+ - Spork now supports alerting using irccat when a cookbook upload or promote --remote happens
73
+ - It will also optionally post a gist of version constraint changes in the above message when a promote --remote happens
74
+ - Added support for default environments to promote to
75
+ - knife-spork gemification thanks to Daniel Schauenberg
76
+
77
+ Bugfixes:
78
+
79
+ - Various bugfixes and tweaks to formatting and log messages
80
+
81
+ ## 0.1.4 (3rd February, 2012)
82
+
83
+ Yanked
84
+
85
+ ## 0.1.3 (3rd February, 2012)
86
+
87
+ Yanked
88
+
89
+ ## 0.1.2 (3rd February, 2012)
90
+
91
+ Yanked
92
+
93
+ ## 0.1.1 (3rd February, 2012)
94
+
95
+ Yanked
96
+
97
+ ## 0.1.0 (January 28, 2012)
98
+
99
+ Initial version.
data/README.md CHANGED
@@ -32,6 +32,13 @@ Below is a sample config file with all supported options enabled below, followed
32
32
  ````
33
33
  git:
34
34
  enabled: true
35
+ hipchat:
36
+ enabled: true
37
+ apikey: MYAPIKEYHERE
38
+ nickname: "Knife-Spork"
39
+ room: "Chef"
40
+ notify: true
41
+ color: "red"
35
42
  irccat:
36
43
  enabled: true
37
44
  server: irccat.mycompany.com
@@ -60,6 +67,15 @@ This section enables a couple of git commands which will run as part of your spo
60
67
  * When you bump a cookbook's version, the relevant metadata.rb file will be git added
61
68
  * When you promote an environment, git pull will be run before your changes are made.
62
69
 
70
+ ## HipChat
71
+
72
+ Notifications will be sent to the HipChat room of your choice. Currently notifies on
73
+
74
+ * When a cookbook is uploaded using spork upload
75
+ * When an environment is promoted to the server using promote --remote
76
+
77
+ color: "yellow", "red", "green", "purple", or "random"
78
+
63
79
  ## Irccat
64
80
 
65
81
  If you're using the irccat (https://github.com/RJ/irccat) irc bot, this lets you post notifications to the channel of your choice. It currently notifies on
data/knife-spork.gemspec CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
13
13
  ## If your rubyforge_project name is different, then edit it and comment out
14
14
  ## the sub! line in the Rakefile
15
15
  s.name = 'knife-spork'
16
- s.version = '0.1.10'
17
- s.date = '2012-04-12'
16
+ s.version = '0.1.11'
17
+ s.date = '2012-06-05'
18
18
  s.rubyforge_project = 'knife-spork'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -43,6 +43,7 @@ Gem::Specification.new do |s|
43
43
  s.add_dependency('chef', [">= 0.10.4"])
44
44
  s.add_dependency('git', [">= 1.2.5"])
45
45
  s.add_dependency('app_conf', [">= 0.4.0"])
46
+ s.add_dependency('hipchat', [">= 0.4.0"])
46
47
 
47
48
  ## Leave this section as-is. It will be automatically generated from the
48
49
  ## contents of your Git repository via the gemspec task. DO NOT REMOVE
@@ -50,6 +51,7 @@ Gem::Specification.new do |s|
50
51
  # = MANIFEST =
51
52
  s.files = %w[
52
53
  README.md
54
+ CHANGELOG.md
53
55
  Rakefile
54
56
  knife-spork.gemspec
55
57
  lib/chef/knife/spork-bump.rb
@@ -130,7 +130,7 @@ module KnifeSpork
130
130
  metadata_file = File.join(cookbook_path, cookbook, "metadata.rb")
131
131
  old_version = current_version.join('.')
132
132
  new_version = bumped_version.join('.')
133
- update_metadata(old_version, new_version, metadata_file)
133
+ update_version(new_version, metadata_file)
134
134
  ui.msg("Bumping #{type} level of the #{cookbook} cookbook from #{old_version} to #{new_version}\n\n")
135
135
  end
136
136
 
@@ -150,15 +150,15 @@ module KnifeSpork
150
150
  end
151
151
 
152
152
  metadata_file = File.join(cookbook_path, cookbook, "metadata.rb")
153
- update_metadata(current_version, version, metadata_file)
153
+ update_version(version, metadata_file)
154
154
  ui.msg("Manually bumped version of the #{cookbook} cookbook from #{current_version} to #{version}")
155
155
  end
156
156
 
157
- def update_metadata(old_version, new_version, metadata_file)
157
+ def update_version(new_version, metadata_file)
158
158
  open_file = File.open(metadata_file, "r")
159
159
  body_of_file = open_file.read
160
160
  open_file.close
161
- body_of_file.gsub!(old_version, new_version)
161
+ body_of_file.gsub!(/version\s+"[0-9\.]+"/, "version \"#{new_version}\"")
162
162
  File.open(metadata_file, "w") { |file| file << body_of_file }
163
163
  end
164
164
 
@@ -29,6 +29,7 @@ require 'app_conf'
29
29
  require 'chef/knife'
30
30
  require 'json'
31
31
  require 'socket'
32
+ require 'hipchat'
32
33
 
33
34
  module KnifeSpork
34
35
  class SporkPromote < Chef::Knife
@@ -260,6 +261,16 @@ module KnifeSpork
260
261
  puts "Something went wrong with sending to irccat: (#{msg})"
261
262
  end
262
263
  end
264
+
265
+ if !@conf.hipchat.nil? && @conf.hipchat.enabled
266
+ begin
267
+ message = "#{ENV['USER']} uploaded environment #{environment.gsub(".json","")} #{@gist}"
268
+ client = HipChat::Client.new(@conf.hipchat.apikey)
269
+ client["#{@conf.hipchat.room}"].send( @conf.hipchat.nickname, message, :notify => @conf.hipchat.notify, :color => @conf.hipchat.color )
270
+ rescue Exception => msg
271
+ puts "Something went wrong with sending to HipChat: (#{msg})"
272
+ end
273
+ end
263
274
 
264
275
  if !@conf.eventinator.nil? && @conf.eventinator.enabled
265
276
  metadata = {}
@@ -30,6 +30,7 @@
30
30
  require 'app_conf'
31
31
  require 'chef/knife'
32
32
  require 'socket'
33
+ require 'hipchat'
33
34
 
34
35
  module KnifeSpork
35
36
  class SporkUpload < Chef::Knife
@@ -148,6 +149,16 @@ module KnifeSpork
148
149
  end
149
150
  end
150
151
 
152
+ if !@conf.hipchat.nil? && @conf.hipchat.enabled
153
+ begin
154
+ message = "#{ENV['USER']} uploaded and froze cookbook #{cookbook_name} version #{cookbook.version}"
155
+ client = HipChat::Client.new(@conf.hipchat.apikey)
156
+ client["#{@conf.hipchat.room}"].send( @conf.hipchat.nickname, message, :notify => @conf.hipchat.notify, :color => @conf.hipchat.color )
157
+ rescue Exception => msg
158
+ puts "Something went wrong with sending to HipChat: (#{msg})"
159
+ end
160
+ end
161
+
151
162
  if !@conf.eventinator.nil? && @conf.eventinator.enabled
152
163
  metadata = {}
153
164
  metadata[:cookbook_name] = cookbook.name
data/lib/knife-spork.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module KnifeSpork
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
metadata CHANGED
@@ -1,77 +1,69 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: knife-spork
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 1
8
- - 10
9
- version: 0.1.10
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.11
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Jon Cowie
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2012-04-12 00:00:00 +01:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-06-05 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: chef
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &70361791232900 !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
26
- - - ">="
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 0
30
- - 10
31
- - 4
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
32
21
  version: 0.10.4
33
22
  type: :runtime
34
- version_requirements: *id001
35
- - !ruby/object:Gem::Dependency
36
- name: git
37
23
  prerelease: false
38
- requirement: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: *70361791232900
25
+ - !ruby/object:Gem::Dependency
26
+ name: git
27
+ requirement: &70361791232420 !ruby/object:Gem::Requirement
39
28
  none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- segments:
44
- - 1
45
- - 2
46
- - 5
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
47
32
  version: 1.2.5
48
33
  type: :runtime
49
- version_requirements: *id002
50
- - !ruby/object:Gem::Dependency
34
+ prerelease: false
35
+ version_requirements: *70361791232420
36
+ - !ruby/object:Gem::Dependency
51
37
  name: app_conf
38
+ requirement: &70361791231940 !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: 0.4.0
44
+ type: :runtime
52
45
  prerelease: false
53
- requirement: &id003 !ruby/object:Gem::Requirement
46
+ version_requirements: *70361791231940
47
+ - !ruby/object:Gem::Dependency
48
+ name: hipchat
49
+ requirement: &70361790131840 !ruby/object:Gem::Requirement
54
50
  none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- segments:
59
- - 0
60
- - 4
61
- - 0
51
+ requirements:
52
+ - - ! '>='
53
+ - !ruby/object:Gem::Version
62
54
  version: 0.4.0
63
55
  type: :runtime
64
- version_requirements: *id003
56
+ prerelease: false
57
+ version_requirements: *70361790131840
65
58
  description: A workflow plugin to help many devs work with the same chef repo/server
66
59
  email: jonlives@gmail.com
67
60
  executables: []
68
-
69
61
  extensions: []
70
-
71
- extra_rdoc_files:
62
+ extra_rdoc_files:
72
63
  - README.md
73
- files:
64
+ files:
74
65
  - README.md
66
+ - CHANGELOG.md
75
67
  - Rakefile
76
68
  - knife-spork.gemspec
77
69
  - lib/chef/knife/spork-bump.rb
@@ -79,37 +71,30 @@ files:
79
71
  - lib/chef/knife/spork-promote.rb
80
72
  - lib/chef/knife/spork-upload.rb
81
73
  - lib/knife-spork.rb
82
- has_rdoc: true
83
74
  homepage: https://github.com/jonlives/knife-spork
84
75
  licenses: []
85
-
86
76
  post_install_message:
87
- rdoc_options:
77
+ rdoc_options:
88
78
  - --charset=UTF-8
89
- require_paths:
79
+ require_paths:
90
80
  - lib
91
- required_ruby_version: !ruby/object:Gem::Requirement
81
+ required_ruby_version: !ruby/object:Gem::Requirement
92
82
  none: false
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- segments:
97
- - 0
98
- version: "0"
99
- required_rubygems_version: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
100
88
  none: false
101
- requirements:
102
- - - ">="
103
- - !ruby/object:Gem::Version
104
- segments:
105
- - 0
106
- version: "0"
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
107
93
  requirements: []
108
-
109
94
  rubyforge_project: knife-spork
110
- rubygems_version: 1.3.7
95
+ rubygems_version: 1.8.10
111
96
  signing_key:
112
97
  specification_version: 2
113
98
  summary: A workflow plugin to help many devs work with the same chef repo/server
114
99
  test_files: []
115
-
100
+ has_rdoc: