captainu-chinook 0.1.2 → 0.1.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8a2f080938d3d45b3fa7d23f248bc082a8e7a350
4
- data.tar.gz: c1efcb423009afcc4b4798f8f16a9ca37a59e868
3
+ metadata.gz: 72f7231f7bab8df6d487ebbc799745ca4e07b364
4
+ data.tar.gz: 613b87cdefc9d478a4cfb9114ae6474d1b3ca819
5
5
  SHA512:
6
- metadata.gz: 2f90797e20e927721687317b295d1635bc81677213d9983f73df07fb7d9fcaa61f5faad505e4a06e2ae8918403210195c97e351dd5112f33015e9e33e2aa7105
7
- data.tar.gz: adf5fb0b81810e204ce8ace7cecf77cb17a06217d01cbafc990574b7c67ede3d8fb747847e37bb6f59ae064831b6babb01bca6872afcb1f6200533e92b2763a4
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 is about to start.'
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 has finished.'
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.'
@@ -1,3 +1,3 @@
1
1
  module Chinook
2
- VERSION = '0.1.2'
2
+ VERSION = '0.1.3'
3
3
  end
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.2
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-03-07 00:00:00.000000000 Z
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: