capistrano3-campfire 0.1.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 +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +67 -0
- data/Rakefile +2 -0
- data/capistrano3-campfire.gemspec +23 -0
- data/lib/capistrano3-campfire.rb +0 -0
- data/lib/capistrano3/campfire.rb +1 -0
- data/lib/capistrano3/campfire/notifier.rb +17 -0
- data/lib/capistrano3/campfire/version.rb +5 -0
- data/lib/capistrano3/tasks/campfire.cap +33 -0
- metadata +98 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5339b2c21444bf6df0b19454ccb6fd61c1ea1781
|
4
|
+
data.tar.gz: 2202dda0dfb8b9417edaaaba41ec047dabee1181
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e462593d3c080ab72a41abb7a4b6099d72ef6ea0c57d69b7b665947df1581785b2a145802ca8a8defaf1ec3a1c4cf6535606c044f38a30e7777c429f841b45ba
|
7
|
+
data.tar.gz: bd78f2df426bffe23d1c1d558155be4f03a342254aa9a4490e7ef2ddc187a042551f12bcddb4e5b33d65a738b9c2e914fff9664b872ea0e8e57bbd9956364cb5
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.bundle
|
19
|
+
*.so
|
20
|
+
*.o
|
21
|
+
*.a
|
22
|
+
mkmf.log
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Yury Velikanau
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
Capistrano3::Campfire
|
2
|
+
=====================
|
3
|
+
|
4
|
+
Simple Campfire notifications for Capistrano 3
|
5
|
+
|
6
|
+
Installation
|
7
|
+
------------
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'capistrano3-campfire', group: :development
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
```shell
|
18
|
+
$ bundle
|
19
|
+
```
|
20
|
+
|
21
|
+
Add this line to your application's Capfile:
|
22
|
+
|
23
|
+
```ruby
|
24
|
+
require 'capistrano3/campfire'
|
25
|
+
```
|
26
|
+
|
27
|
+
Usage
|
28
|
+
-----
|
29
|
+
|
30
|
+
Add this line to your `deploy.rb` file:
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
after :publishing, 'campfire:deploy'
|
34
|
+
```
|
35
|
+
|
36
|
+
or at any other point on your choice.
|
37
|
+
|
38
|
+
Configure Campfire access:
|
39
|
+
|
40
|
+
```ruby
|
41
|
+
set :campfire_subdomain, 'subdomain'
|
42
|
+
set :campfire_token, 'token'
|
43
|
+
set :campfire_room_id, 123
|
44
|
+
```
|
45
|
+
|
46
|
+
You can change default message as a whole:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
set :campfire_message, -> { 'your message' }
|
50
|
+
```
|
51
|
+
|
52
|
+
or by setting these variables
|
53
|
+
|
54
|
+
```ruby
|
55
|
+
set :campfire_user, 'me'
|
56
|
+
set :campfire_sha, fetch(:branch)
|
57
|
+
set :campfire_env, fetch(:stage)
|
58
|
+
```
|
59
|
+
|
60
|
+
Contributing
|
61
|
+
------------
|
62
|
+
|
63
|
+
1. Fork it ( https://github.com/spectator/capistrano3-campfire/fork )
|
64
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
65
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
66
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
67
|
+
5. Create a new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'capistrano3/campfire/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'capistrano3-campfire'
|
8
|
+
spec.version = Capistrano3::Campfire::VERSION
|
9
|
+
spec.authors = ["Yury Velikanau"]
|
10
|
+
spec.email = ["yury.velikanau@gmail.com"]
|
11
|
+
spec.summary = %q{Simple Campfire notifications for Capistrano 3}
|
12
|
+
spec.homepage = 'https://github.com/spectator/capistrano3-campfire'
|
13
|
+
spec.license = 'MIT'
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0")
|
16
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
17
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
18
|
+
spec.require_paths = ['lib']
|
19
|
+
|
20
|
+
spec.add_dependency 'tinder', '>= 1.9.0'
|
21
|
+
spec.add_development_dependency 'bundler'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
load File.expand_path('../tasks/campfire.cap', __FILE__)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module Capistrano3
|
2
|
+
module Campfire
|
3
|
+
class Notifier
|
4
|
+
attr_reader :room_id, :driver
|
5
|
+
|
6
|
+
def initialize(room_id, driver)
|
7
|
+
@room_id = room_id
|
8
|
+
@driver = driver
|
9
|
+
end
|
10
|
+
|
11
|
+
def notify(message)
|
12
|
+
room = driver.find_room_by_id(room_id)
|
13
|
+
room.speak(message)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'tinder'
|
2
|
+
require File.expand_path('../../campfire/notifier', __FILE__)
|
3
|
+
|
4
|
+
namespace :campfire do
|
5
|
+
desc 'Trigger deploy notification to Campfire'
|
6
|
+
task :deploy do
|
7
|
+
run_locally do
|
8
|
+
driver = Tinder::Campfire.new(
|
9
|
+
fetch(:campfire_subdomain), token: fetch(:campfire_token))
|
10
|
+
|
11
|
+
notifier = Capistrano3::Campfire::Notifier.new(
|
12
|
+
fetch(:campfire_room_id), driver)
|
13
|
+
|
14
|
+
notifier.notify(fetch(:campfire_message, message))
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def message
|
19
|
+
"#{message_user} deployed #{message_sha} to #{message_env}"
|
20
|
+
end
|
21
|
+
|
22
|
+
def message_user
|
23
|
+
ENV['USER'] || fetch(:campfire_user)
|
24
|
+
end
|
25
|
+
|
26
|
+
def message_sha
|
27
|
+
fetch(:branch, fetch(:campfire_sha))
|
28
|
+
end
|
29
|
+
|
30
|
+
def message_env
|
31
|
+
fetch(:stage, fetch(:campfire_env))
|
32
|
+
end
|
33
|
+
end
|
metadata
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: capistrano3-campfire
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Yury Velikanau
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-04-26 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: tinder
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.9.0
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.9.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: bundler
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rake
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
description:
|
56
|
+
email:
|
57
|
+
- yury.velikanau@gmail.com
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- Gemfile
|
64
|
+
- LICENSE.txt
|
65
|
+
- README.md
|
66
|
+
- Rakefile
|
67
|
+
- capistrano3-campfire.gemspec
|
68
|
+
- lib/capistrano3-campfire.rb
|
69
|
+
- lib/capistrano3/campfire.rb
|
70
|
+
- lib/capistrano3/campfire/notifier.rb
|
71
|
+
- lib/capistrano3/campfire/version.rb
|
72
|
+
- lib/capistrano3/tasks/campfire.cap
|
73
|
+
homepage: https://github.com/spectator/capistrano3-campfire
|
74
|
+
licenses:
|
75
|
+
- MIT
|
76
|
+
metadata: {}
|
77
|
+
post_install_message:
|
78
|
+
rdoc_options: []
|
79
|
+
require_paths:
|
80
|
+
- lib
|
81
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ">="
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ">="
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
91
|
+
requirements: []
|
92
|
+
rubyforge_project:
|
93
|
+
rubygems_version: 2.2.2
|
94
|
+
signing_key:
|
95
|
+
specification_version: 4
|
96
|
+
summary: Simple Campfire notifications for Capistrano 3
|
97
|
+
test_files: []
|
98
|
+
has_rdoc:
|