captainu-chinook 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chinook/capistrano/campfire.rb +22 -2
- data/lib/chinook/version.rb +1 -1
- data/readme.markdown +2 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72f7231f7bab8df6d487ebbc799745ca4e07b364
|
4
|
+
data.tar.gz: 613b87cdefc9d478a4cfb9114ae6474d1b3ca819
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3667a63b2a5aacc28e564ee0f1bd0fcedae23eea2e0b272a31e09f71b7e06635976aead2692a6f92dbdf8afc691d296cd760ab5b320025c2e7c4a61655d77fdf
|
7
|
+
data.tar.gz: d525ba3dae3bc502511f1ab3d61ed7ca2a6bc838e8bad8934801cbcd37a0094691710fa7e5e19fff55ddff7beac61bf70f0a37a984976d13348c62e77a26a816
|
@@ -7,7 +7,7 @@ module Chinook::Capistrano
|
|
7
7
|
def self.load_into(configuration)
|
8
8
|
configuration.load do
|
9
9
|
namespace :chinook do
|
10
|
-
desc 'Lets a Campfire room know about a deploy that
|
10
|
+
desc 'Lets a Campfire room know about a deploy that has begun.'
|
11
11
|
task :campfire_start, except: { no_release: true } do
|
12
12
|
unless exists?(:campfire_room_name) && exists?(:campfire_token) && exists?(:campfire_account_name)
|
13
13
|
logger.info 'Cannot notify Campfire without :campfire_room_name, :campfire_token, and :campfire_account_name. Skipping task.'
|
@@ -27,7 +27,27 @@ module Chinook::Capistrano
|
|
27
27
|
room.speak(message)
|
28
28
|
end
|
29
29
|
|
30
|
-
desc 'Lets a Campfire room know about a deploy
|
30
|
+
desc 'Lets a Campfire room know about a deploy that is rolling back.'
|
31
|
+
task :campfire_rollback, except: { no_release: true } do
|
32
|
+
unless exists?(:campfire_room_name) && exists?(:campfire_token) && exists?(:campfire_account_name)
|
33
|
+
logger.info 'Cannot notify Campfire without :campfire_room_name, :campfire_token, and :campfire_account_name. Skipping task.'
|
34
|
+
next
|
35
|
+
end
|
36
|
+
|
37
|
+
project_name = fetch(:project_name, application)
|
38
|
+
git_username = `git config user.name`.chomp
|
39
|
+
|
40
|
+
message = "#{git_username}'s deploy of #{project_name} to #{stage} has been rolled back at #{Time.now.strftime('%r %Z')}."
|
41
|
+
room_name = fetch(:campfire_room_name)
|
42
|
+
token = fetch(:campfire_token)
|
43
|
+
account_name = fetch(:campfire_account_name)
|
44
|
+
|
45
|
+
campfire = Tinder::Campfire.new(account_name, token: token)
|
46
|
+
room = campfire.find_room_by_name(room_name)
|
47
|
+
room.speak(message)
|
48
|
+
end
|
49
|
+
|
50
|
+
desc 'Lets a Campfire room know about a deploy that has finished.'
|
31
51
|
task :campfire_end, except: { no_release: true } do
|
32
52
|
unless exists?(:campfire_room_name) && exists?(:campfire_token) && exists?(:campfire_account_name)
|
33
53
|
logger.info 'Cannot notify Campfire without :campfire_room_name, :campfire_token, and :campfire_account_name. Skipping task.'
|
data/lib/chinook/version.rb
CHANGED
data/readme.markdown
CHANGED
@@ -44,9 +44,11 @@ Notifies [Campfire](https://campfirenow.com) when a deploy starts and/or stops.
|
|
44
44
|
|
45
45
|
* Tasks:
|
46
46
|
- `chinook:campfire_start`
|
47
|
+
- `chinook:campfire_fail`
|
47
48
|
- `chinook:campfire_end`
|
48
49
|
* Hooks:
|
49
50
|
- `before 'deploy', 'chinook:campfire_start'`
|
51
|
+
- `after 'deploy:rollback', 'chinook:campfire_rollback'`
|
50
52
|
- `after 'deploy', 'chinook:campfire_end'`
|
51
53
|
* Settings:
|
52
54
|
- `:campfire_room_name`: the room where notifications will be posted.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: captainu-chinook
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Kreeger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -111,3 +111,4 @@ signing_key:
|
|
111
111
|
specification_version: 4
|
112
112
|
summary: Abstraction of Capistrano v2 deployment tasks.
|
113
113
|
test_files: []
|
114
|
+
has_rdoc:
|