capistrano-jabber-notifications 0.1.2 → 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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: bc3dfb7fe65de3c04bb1281e1536b523d9babdb7
4
+ data.tar.gz: de4a30678ca44627ea77ec23ff7080fc833c4779
5
+ SHA512:
6
+ metadata.gz: 80ba605d647e6f7b1843c31146360623c87d3c62b77a42e2b957a49494b0a9f40b7ca5fbf487ea8266686fb6d2690baae7864790c51d9dac453b4329931e8636
7
+ data.tar.gz: c4e359c6ae0ce19c65de9b34d6462dd5f774976b4c368830035b01534a5a09a604bece1df060f58801d2ebea178a3f8539731731a1730984ec2ca497e336d800
data/README.md CHANGED
@@ -8,6 +8,10 @@ Add this line to your application's Gemfile:
8
8
 
9
9
  gem 'capistrano-jabber-notifications'
10
10
 
11
+ or
12
+
13
+ gem 'capistrano-jabber-notifications', :github => "netbrick/capistrano-jabber-notifications"
14
+
11
15
  And then execute:
12
16
 
13
17
  $ bundle
@@ -18,7 +22,16 @@ Or install it yourself as:
18
22
 
19
23
  ## Usage
20
24
 
21
- TODO: Write usage instructions here
25
+ Add into capistrano configuration:
26
+
27
+ require 'capistrano/jabber/notifications'
28
+
29
+ set :jabber_uid, 'capistrano@jabbim.cz'
30
+ set :jabber_server, 'jabbim.cz'
31
+ set :jabber_password, 'superSecretPassword'
32
+ set :jabber_group, []
33
+ set :jabber_members, ["developer0@netbrick.cz", "developer1@netbrick.cz"]
34
+
22
35
 
23
36
  ## Contributing
24
37
 
@@ -6,8 +6,8 @@ require 'capistrano/jabber/notifications/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "capistrano-jabber-notifications"
8
8
  spec.version = Capistrano::Jabber::Notifications::VERSION
9
- spec.authors = ["Pavel Lazureykis"]
10
- spec.email = ["lazureykis@gmail.com"]
9
+ spec.authors = ["Pavel Lazureykis", "NetBrick"]
10
+ spec.email = ["lazureykis@gmail.com", "info@netbrick.eu"]
11
11
  spec.description = %q{Sending notifications about deploy to jabber}
12
12
  spec.summary = %q{Sending notifications about deploy to jabber}
13
13
  spec.homepage = ""
@@ -31,6 +31,21 @@ module Capistrano
31
31
 
32
32
  private
33
33
 
34
+ def git_log_revisions
35
+ current, real = variables[:current_revision][0,7], variables[:real_revision][0,7]
36
+
37
+ if current == real
38
+ "GIT: No changes ..."
39
+ else
40
+ if (diff = `git log #{current}..#{real} --oneline`) != ""
41
+ diff = " " << diff.gsub("\n", "\n ") << "\n"
42
+ "\nGIT Changes:\n" + diff
43
+ else
44
+ "GIT: Git-log problem ..."
45
+ end
46
+ end
47
+ end
48
+
34
49
  def send_jabber_message(action, completed = false)
35
50
  msg = []
36
51
  msg << "#{completed ? 'Completed' : 'Started'} #{action} on #{variables[:stage]} by #{username}"
@@ -39,12 +54,14 @@ module Capistrano
39
54
  msg << "Branch #{variables[:branch]}"
40
55
  msg << "Revision #{options[:real_revision]}"
41
56
  msg << "Release name #{options[:release_name]}"
57
+ msg << git_log_revisions if variables[:source].is_a?(Capistrano::Deploy::SCM::Git)
42
58
  msg = msg.join("\r\n")
43
59
 
44
60
  client = ::Jabber::Client.new(options[:uid].to_s)
45
61
  client.connect(options[:server].to_s)
46
62
  client.auth(options[:password].to_s)
47
63
  notification_group = options[:group].to_s
64
+ notification_list = options[:members]
48
65
 
49
66
  roster = ::Jabber::Roster::Helper.new(client)
50
67
 
@@ -58,6 +75,12 @@ module Capistrano
58
75
  client.send(m)
59
76
  }
60
77
 
78
+ notification_list.each { |member|
79
+ client.send(member)
80
+ m = ::Jabber::Message.new(member, msg).set_type(:normal).set_id('1').set_subject('deploy')
81
+ client.send(m)
82
+ }
83
+
61
84
  client.close
62
85
  true
63
86
  end
@@ -82,6 +105,7 @@ Capistrano::Configuration.instance(:must_exist).load do
82
105
  server: fetch(:jabber_server),
83
106
  password: fetch(:jabber_password),
84
107
  group: fetch(:jabber_group),
108
+ members: fetch(:jabber_members),
85
109
  real_revision: fetch(:real_revision),
86
110
  release_name: fetch(:release_name),
87
111
  action: m.to_sym
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Jabber
3
3
  module Notifications
4
- VERSION = "0.1.2"
4
+ VERSION = "0.2.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,35 +1,39 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-jabber-notifications
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
5
- prerelease:
4
+ version: 0.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Pavel Lazureykis
8
+ - NetBrick
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-02 00:00:00.000000000 Z
12
+ date: 2014-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: xmpp4r
16
- requirement: &13502920 !ruby/object:Gem::Requirement
17
- none: false
16
+ requirement: !ruby/object:Gem::Requirement
18
17
  requirements:
19
- - - =
18
+ - - '='
20
19
  - !ruby/object:Gem::Version
21
20
  version: '0.5'
22
21
  type: :runtime
23
22
  prerelease: false
24
- version_requirements: *13502920
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '='
26
+ - !ruby/object:Gem::Version
27
+ version: '0.5'
25
28
  description: Sending notifications about deploy to jabber
26
29
  email:
27
30
  - lazureykis@gmail.com
31
+ - info@netbrick.eu
28
32
  executables: []
29
33
  extensions: []
30
34
  extra_rdoc_files: []
31
35
  files:
32
- - .gitignore
36
+ - ".gitignore"
33
37
  - Gemfile
34
38
  - LICENSE.txt
35
39
  - README.md
@@ -40,32 +44,25 @@ files:
40
44
  homepage: ''
41
45
  licenses:
42
46
  - MIT
47
+ metadata: {}
43
48
  post_install_message:
44
49
  rdoc_options: []
45
50
  require_paths:
46
51
  - lib
47
52
  required_ruby_version: !ruby/object:Gem::Requirement
48
- none: false
49
53
  requirements:
50
- - - ! '>='
54
+ - - ">="
51
55
  - !ruby/object:Gem::Version
52
56
  version: '0'
53
- segments:
54
- - 0
55
- hash: -3424211791560226970
56
57
  required_rubygems_version: !ruby/object:Gem::Requirement
57
- none: false
58
58
  requirements:
59
- - - ! '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
- segments:
63
- - 0
64
- hash: -3424211791560226970
65
62
  requirements: []
66
63
  rubyforge_project:
67
- rubygems_version: 1.8.11
64
+ rubygems_version: 2.2.1
68
65
  signing_key:
69
- specification_version: 3
66
+ specification_version: 4
70
67
  summary: Sending notifications about deploy to jabber
71
68
  test_files: []