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 +12 -13
- data/capistrano-payload.gemspec +1 -1
- data/lib/capistrano-payload.rb +1 -0
- data/lib/capistrano-payload/capistrano_integration.rb +3 -3
- data/lib/capistrano-payload/errors.rb +4 -0
- data/lib/capistrano-payload/payload.rb +0 -3
- data/lib/capistrano-payload/version.rb +3 -1
- data/spec/fixtures/payload.form +1 -1
- data/spec/fixtures/payload.json +1 -1
- data/spec/fixtures/payload.xml +1 -1
- data/spec/fixtures/payload.yml +1 -1
- metadata +4 -3
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
|
-
##
|
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
|
-
-
|
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": "
|
41
|
+
"application": "foobar",
|
43
42
|
"deployer": {
|
44
|
-
"user": "
|
45
|
-
"hostname": "localhost"
|
46
|
-
}
|
47
|
-
"timestamp": "2011-
|
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": "
|
52
|
-
"repository": "git@github.com:
|
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.
|
55
|
+
"payload_version": "0.4.0"
|
57
56
|
}
|
58
57
|
|
59
58
|
That's it. Ready to roll.
|
data/capistrano-payload.gemspec
CHANGED
@@ -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', '~>
|
25
|
+
gem.add_runtime_dependency 'builder', '~> 2.1'
|
26
26
|
end
|
data/lib/capistrano-payload.rb
CHANGED
@@ -10,7 +10,7 @@ module CapistranoPayload
|
|
10
10
|
abort 'Payload URL required! set :payload_url'
|
11
11
|
}
|
12
12
|
|
13
|
-
_cset(:
|
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 =
|
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 =
|
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
|
data/spec/fixtures/payload.form
CHANGED
@@ -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.
|
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
|
data/spec/fixtures/payload.json
CHANGED
data/spec/fixtures/payload.xml
CHANGED
data/spec/fixtures/payload.yml
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: capistrano-payload
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 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-
|
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: "
|
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
|