Class: KnifeSpork::Plugins::HipChat

Inherits:
Plugin
  • Object
show all
Defined in:
lib/knife-spork/plugins/hipchat.rb

Instance Method Summary collapse

Methods inherited from Plugin

#enabled?, hook, hooks, #initialize, name

Constructor Details

This class inherits a constructor from KnifeSpork::Plugins::Plugin

Instance Method Details

#after_databagcreateObject



71
72
73
74
# File 'lib/knife-spork/plugins/hipchat.rb', line 71

def after_databagcreate
  databag_gist = object_gist("databag item", "#{object_name}:#{object_secondary_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} created data bag #{object_name} #{databag_gist}"
end

#after_databagdeleteObject



76
77
78
79
# File 'lib/knife-spork/plugins/hipchat.rb', line 76

def after_databagdelete
  databag_gist = object_gist("databag item", "#{object_name}:#{object_secondary_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} deleted data bag item #{object_name} #{databag_gist}"
end

#after_databageditObject



66
67
68
69
# File 'lib/knife-spork/plugins/hipchat.rb', line 66

def after_databagedit
  databag_gist = object_gist("databag item", "#{object_name}:#{object_secondary_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} edited data bag item #{object_name}:#{object_secondary_name} #{databag_gist}"
end

#after_databagfromfileObject



86
87
88
89
# File 'lib/knife-spork/plugins/hipchat.rb', line 86

def after_databagfromfile
  databag_gist = object_gist("databag item", "#{object_name}:#{object_secondary_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} uploaded data bag item #{object_name}:#{object_secondary_name} #{databag_gist}"
end

#after_databagitemdeleteObject



81
82
83
84
# File 'lib/knife-spork/plugins/hipchat.rb', line 81

def after_databagitemdelete
  databag_gist = object_gist("databag item", "#{object_name}:#{object_secondary_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} deleted data bag item #{object_name}:#{object_secondary_name} #{databag_gist}"
end

#after_deleteObject



14
15
16
# File 'lib/knife-spork/plugins/hipchat.rb', line 14

def after_delete
  hipchat "#{organization}#{current_user} deleted the following cookbooks: #{misc_output}"
end

#after_environmentcreateObject



36
37
38
39
# File 'lib/knife-spork/plugins/hipchat.rb', line 36

def after_environmentcreate
  environment_gist = object_gist("environment", object_name, object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} created environment #{object_name} #{environment_gist}"
end

#after_environmentdeleteObject



41
42
43
44
# File 'lib/knife-spork/plugins/hipchat.rb', line 41

def after_environmentdelete
  environment_gist = object_gist("environment", object_name, object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} deleted environment #{object_name} #{environment_gist}"
end

#after_environmenteditObject



31
32
33
34
# File 'lib/knife-spork/plugins/hipchat.rb', line 31

def after_environmentedit
  environment_gist = object_gist("environment", object_name, object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} edited environment #{object_name} #{environment_gist}"
end

#after_environmentfromfileObject



26
27
28
29
# File 'lib/knife-spork/plugins/hipchat.rb', line 26

def after_environmentfromfile
  environment_gist = object_gist("environment", object_name, object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} uploaded environment #{object_name} #{environment_gist}"
end

#after_nodecreateObject



101
102
103
104
# File 'lib/knife-spork/plugins/hipchat.rb', line 101

def after_nodecreate
  node_gist = object_gist("node", "#{object_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} created node #{object_name} #{node_gist}"
end

#after_nodedeleteObject



96
97
98
99
# File 'lib/knife-spork/plugins/hipchat.rb', line 96

def after_nodedelete
  node_gist = object_gist("node", "#{object_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} deleted node #{object_name} #{node_gist}"
end

#after_nodeeditObject



91
92
93
94
# File 'lib/knife-spork/plugins/hipchat.rb', line 91

def after_nodeedit
  node_gist = object_gist("node", "#{object_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} edited node #{object_name} #{node_gist}"
end

#after_nodefromfileObject



106
107
108
109
# File 'lib/knife-spork/plugins/hipchat.rb', line 106

def after_nodefromfile
  node_gist = object_gist("node", "#{object_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} uploaded node #{object_name} #{node_gist}"
end

#after_noderunlistaddObject



111
112
113
114
# File 'lib/knife-spork/plugins/hipchat.rb', line 111

def after_noderunlistadd
  node_gist = object_gist("node", "#{object_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} added run_list items to #{object_name}: #{object_secondary_name} #{node_gist}"
end

#after_noderunlistremoveObject



116
117
118
119
# File 'lib/knife-spork/plugins/hipchat.rb', line 116

def after_noderunlistremove
  node_gist = object_gist("node", "#{object_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} removed run_list items from #{object_name}: #{object_secondary_name} #{node_gist}"
end

#after_noderunlistsetObject



121
122
123
124
# File 'lib/knife-spork/plugins/hipchat.rb', line 121

def after_noderunlistset
  node_gist = object_gist("node", "#{object_name}", object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} set the run_list for #{object_name} to #{object_secondary_name} #{node_gist}"
end

#after_promote_remoteObject



18
19
20
21
22
23
24
# File 'lib/knife-spork/plugins/hipchat.rb', line 18

def after_promote_remote
 environments.each do |environment|
    diff = environment_diffs[environment.name]
    env_gist = env_gist(environment, diff) if config.gist
    hipchat "#{organization}#{current_user} promoted the following cookbooks:\n#{cookbooks.collect{ |c| "  #{c.name}@#{c.version}" }.join("\n")} to #{environment} #{env_gist}"
 end
end

#after_rolecreateObject



56
57
58
59
# File 'lib/knife-spork/plugins/hipchat.rb', line 56

def after_rolecreate
  role_gist = object_gist("role", object_name, object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} created role #{object_name} #{role_gist}"
end

#after_roledeleteObject



61
62
63
64
# File 'lib/knife-spork/plugins/hipchat.rb', line 61

def after_roledelete
  role_gist = object_gist("role", object_name, object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} deleted role #{object_name} #{role_gist}"
end

#after_roleeditObject



51
52
53
54
# File 'lib/knife-spork/plugins/hipchat.rb', line 51

def after_roleedit
  role_gist = object_gist("role", object_name, object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} edited role #{object_name} #{role_gist}"
end

#after_rolefromfileObject



46
47
48
49
# File 'lib/knife-spork/plugins/hipchat.rb', line 46

def after_rolefromfile
  role_gist = object_gist("role", object_name, object_difference) if config.gist  and !object_difference.empty?
  hipchat "#{organization}#{current_user} uploaded role #{object_name} #{role_gist}"
end

#after_uploadObject



10
11
12
# File 'lib/knife-spork/plugins/hipchat.rb', line 10

def after_upload
  hipchat "#{organization}#{current_user} uploaded the following cookbooks:\n#{cookbooks.collect{ |c| "  #{c.name}@#{c.version}" }.join("\n")}"
end

#performObject



8
# File 'lib/knife-spork/plugins/hipchat.rb', line 8

def perform; end