capistrano-payload 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  # Capistrano Payload
3
2
 
4
3
  Capistrano plugin that delivers JSON-encoded deployment information via POST to the URL of your choice.
@@ -23,12 +22,12 @@ To test if it works type:
23
22
 
24
23
  The best way to test out is to use http://www.postbin.org/.
25
24
 
26
- ## Options
25
+ ## Configuration options
27
26
 
28
27
  - payload_url — Primary URL where the data would be sent (required)
29
28
  - payload_format — Payload format. Must be one of :json (default), :form, :yaml, :xml
30
29
  - payload_params — Extra parameters to the request (api_key, etc.). *Note: extra parameters wont be added to the payload.*
31
- - payload_message — Ask for deployment comment. (default: true)
30
+ - payload_prompt — Ask for deployment comment. (default: true)
32
31
 
33
32
  ## Payload structure
34
33
 
@@ -39,21 +38,21 @@ Here is an example data:
39
38
  {
40
39
  "capistrano": {
41
40
  "version": "2.6.0",
42
- "application": "APP_NAME",
41
+ "application": "foobar",
43
42
  "deployer": {
44
- "user": "sosedoff",
45
- "hostname": "localhost",
46
- }
47
- "timestamp": "2011-07-21 19:09:52 -0500",
48
- "message": "Release 1.0.0",
43
+ "user": "username",
44
+ "hostname": "localhost"
45
+ },
46
+ "timestamp": "2011-01-01 00:00:00 -0600",
49
47
  "source": {
50
48
  "branch": "master",
51
- "revision": "b18ffa822c16c028765800d0c4d22bfd5e4f3bf9",
52
- "repository": "git@github.com:repository.git"
49
+ "revision": "abcdef",
50
+ "repository": "git@github.com:username/repo.git"
53
51
  },
54
- "action": "deploy"
52
+ "action": "deploy",
53
+ "message": "Comment"
55
54
  },
56
- "payload_version": "0.2.0"
55
+ "payload_version": "0.4.0"
57
56
  }
58
57
 
59
58
  That's it. Ready to roll.
@@ -22,5 +22,5 @@ Gem::Specification.new do |gem|
22
22
  gem.add_runtime_dependency 'capistrano', '~> 2.6'
23
23
  gem.add_runtime_dependency 'rest-client', '~> 1.6'
24
24
  gem.add_runtime_dependency 'multi_json', '~> 1.0'
25
- gem.add_runtime_dependency 'builder', '~> 3.0'
25
+ gem.add_runtime_dependency 'builder', '~> 2.1'
26
26
  end
@@ -1,4 +1,5 @@
1
1
  require 'capistrano-payload/version'
2
+ require 'capistrano-payload/errors'
2
3
  require 'capistrano-payload/request'
3
4
  require 'capistrano-payload/format'
4
5
  require 'capistrano-payload/payload'
@@ -10,7 +10,7 @@ module CapistranoPayload
10
10
  abort 'Payload URL required! set :payload_url'
11
11
  }
12
12
 
13
- _cset(:payload_message) { true }
13
+ _cset(:payload_prompt) { true }
14
14
  _cset(:payload_format) { :json }
15
15
  _cset(:payload_params) { Hash.new }
16
16
 
@@ -34,7 +34,7 @@ module CapistranoPayload
34
34
  namespace :payload do
35
35
  task :deploy, :roles => :app do
36
36
  logger.debug("Sending deployment notification to #{fetch(:payload_url)}")
37
- message = payload_message == true ? Capistrano::CLI.ui.ask("Deployment message (none): ", nil) : ''
37
+ message = payload_prompt == true ? Capistrano::CLI.ui.ask("Deployment message (none): ", nil) : ''
38
38
  begin
39
39
  CapistranoPayload::Payload.new('deploy', message, payload_data, payload_format, payload_params).deliver(payload_url)
40
40
  rescue DeliveryError => err
@@ -46,7 +46,7 @@ module CapistranoPayload
46
46
 
47
47
  task :rollback, :roles => :app do
48
48
  logger.debug("Sending rollback notification to #{fetch(:payload_url)}")
49
- message = payload_message == true ? Capistrano::CLI.ui.ask("Rollback message (none): ", nil) : ''
49
+ message = payload_prompt == true ? Capistrano::CLI.ui.ask("Rollback message (none): ", nil) : ''
50
50
  begin
51
51
  CapistranoPayload::Payload.new('rollback', message, payload_data, payload_format, payload_params).deliver(payload_url)
52
52
  rescue DeliveryError => err
@@ -0,0 +1,4 @@
1
+ module CapistranoPayload
2
+ class ConfigurationError < StandardError ; end
3
+ class DeliveryError < StandardError ; end
4
+ end
@@ -1,7 +1,4 @@
1
1
  module CapistranoPayload
2
- class ConfigurationError < StandardError ; end
3
- class DeliveryError < StandardError ; end
4
-
5
2
  class Payload
6
3
  include CapistranoPayload::Format
7
4
  include CapistranoPayload::Request
@@ -1,3 +1,5 @@
1
1
  module CapistranoPayload
2
- VERSION = "0.3.0".freeze unless defined? ::CapistranoPayload::VERSION
2
+ unless defined?(::CapistranoPayload::VERSION)
3
+ VERSION = "0.4.0".freeze
4
+ end
3
5
  end
@@ -1 +1 @@
1
- payload[capistrano][version]=2.6.0&payload[capistrano][application]=foobar&payload[capistrano][deployer][user]=username&payload[capistrano][deployer][hostname]=localhost&payload[capistrano][timestamp]=2011-01-01%2000%3A00%3A00%20-0600&payload[capistrano][source][branch]=master&payload[capistrano][source][revision]=abcdef&payload[capistrano][source][repository]=git%40github.com%3Ausername%2Frepo.git&payload[capistrano][action]=deploy&payload[capistrano][message]=Comment&payload[payload_version]=0.3.0
1
+ payload[capistrano][version]=2.6.0&payload[capistrano][application]=foobar&payload[capistrano][deployer][user]=username&payload[capistrano][deployer][hostname]=localhost&payload[capistrano][timestamp]=2011-01-01%2000%3A00%3A00%20-0600&payload[capistrano][source][branch]=master&payload[capistrano][source][revision]=abcdef&payload[capistrano][source][repository]=git%40github.com%3Ausername%2Frepo.git&payload[capistrano][action]=deploy&payload[capistrano][message]=Comment&payload[payload_version]=0.4.0
@@ -15,5 +15,5 @@
15
15
  "action": "deploy",
16
16
  "message": "Comment"
17
17
  },
18
- "payload_version": "0.3.0"
18
+ "payload_version": "0.4.0"
19
19
  }
@@ -16,5 +16,5 @@
16
16
  <repository>git@github.com:username/repo.git</repository>
17
17
  </source>
18
18
  </capistrano>
19
- <payload_version>0.3.0</payload_version>
19
+ <payload_version>0.4.0</payload_version>
20
20
  </payload>
@@ -12,4 +12,4 @@
12
12
  :repository: git@github.com:username/repo.git
13
13
  :action: deploy
14
14
  :message: Comment
15
- :payload_version: 0.3.0
15
+ :payload_version: 0.4.0
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: capistrano-payload
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.3.0
5
+ version: 0.4.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Dan Sosedoff
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-07-22 00:00:00 -05:00
13
+ date: 2011-08-01 00:00:00 -05:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -87,7 +87,7 @@ dependencies:
87
87
  requirements:
88
88
  - - ~>
89
89
  - !ruby/object:Gem::Version
90
- version: "3.0"
90
+ version: "2.1"
91
91
  type: :runtime
92
92
  version_requirements: *id007
93
93
  description: Capistrano plugin that delivers JSON payload to the specified URL
@@ -107,6 +107,7 @@ files:
107
107
  - capistrano-payload.gemspec
108
108
  - lib/capistrano-payload.rb
109
109
  - lib/capistrano-payload/capistrano_integration.rb
110
+ - lib/capistrano-payload/errors.rb
110
111
  - lib/capistrano-payload/format.rb
111
112
  - lib/capistrano-payload/payload.rb
112
113
  - lib/capistrano-payload/request.rb