j-cap-recipes 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/README.md +13 -0
- data/lib/j-cap-recipes/airbrake.rb +2 -0
- data/lib/j-cap-recipes/tasks/airbrake.rake +45 -0
- data/lib/j-cap-recipes/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 086e21393f0b2b5b113d801f388aba884d6c35a9
|
4
|
+
data.tar.gz: 4661e17909d7b2e47c9974d2bb04715728c955e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 846b3cbe2a3c266b4783276febbef4b15e1181dd6d7283acbaea4784ae04bb5277b033c5beff98ecd7f737de2a7bcc563f6add00519d60cca0a20ceded44f673
|
7
|
+
data.tar.gz: 37da5b66d6d3917a885b63ae52f8b5fc3ca745d68a5c37561cc3cbe1b65b169f96773959a4b89fde7137824ff27baffa9ca8f597c20f141981432a9f52cf077c
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -35,6 +35,7 @@ If you want to load only specified recipe:
|
|
35
35
|
require 'j-cap-recipes/rails'
|
36
36
|
require 'j-cap-recipes/unicorn'
|
37
37
|
require 'j-cap-recipes/honeybadger'
|
38
|
+
require 'j-cap-recipes/airbrake'
|
38
39
|
|
39
40
|
### Nginx
|
40
41
|
### Setup
|
@@ -114,6 +115,18 @@ To download all share folder use:
|
|
114
115
|
|
115
116
|
To extract the archive `tar -xvf download.tar -C tmp`
|
116
117
|
|
118
|
+
### Airbrake
|
119
|
+
|
120
|
+
Add 'j-cap-recipes/airbrake'` to `Capfile`. The original version capistrano task to notify airbrake service support only
|
121
|
+
Capistrano version 2. Migrate the task to support version 3.
|
122
|
+
|
123
|
+
To send Airbrake deploy notification, you should also add hook to `deploy.rb`
|
124
|
+
|
125
|
+
```ruby
|
126
|
+
after 'deploy:finishing', 'airbrake:deploy'
|
127
|
+
```
|
128
|
+
|
129
|
+
You can change the default api key using `ENV['API_KEY']`.
|
117
130
|
|
118
131
|
## Contributing
|
119
132
|
|
@@ -0,0 +1,45 @@
|
|
1
|
+
namespace :airbrake do
|
2
|
+
desc <<-DESC
|
3
|
+
Notify Airbrake of the deployment by running the notification on the REMOTE machine.
|
4
|
+
- Run remotely so we use remote API keys, environment, etc.
|
5
|
+
DESC
|
6
|
+
task :deploy do
|
7
|
+
rails_env = fetch(:rails_env, "production")
|
8
|
+
airbrake_env = fetch(:airbrake_env, fetch(:rails_env, "production"))
|
9
|
+
local_user = ENV['USER'] || ENV['USERNAME']
|
10
|
+
|
11
|
+
on roles(:app) do
|
12
|
+
within release_path do
|
13
|
+
with rails_env: fetch(:rails_env) do
|
14
|
+
notify_command = [:rake, 'environment airbrake:deploy', "TO=#{airbrake_env}", "REVISION=#{fetch(:current_revision)}",
|
15
|
+
"REPO='#{fetch(:repo_url)}' USER=#{AirbrakeCapistrano::shellescape(local_user)}"]
|
16
|
+
notify_command << "API_KEY=#{ENV['API_KEY']}" if ENV['API_KEY']
|
17
|
+
execute *notify_command
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
module AirbrakeCapistrano
|
25
|
+
def self.shellescape(str)
|
26
|
+
str = str.to_s
|
27
|
+
|
28
|
+
# An empty argument will be skipped, so return empty quotes.
|
29
|
+
return "''" if str.empty?
|
30
|
+
|
31
|
+
str = str.dup
|
32
|
+
|
33
|
+
# Treat multibyte characters as is. It is caller's responsibility
|
34
|
+
# to encode the string in the right encoding for the shell
|
35
|
+
# environment.
|
36
|
+
str.gsub!(/([^A-Za-z0-9_\-.,:\/@\n])/, "\\\\\\1")
|
37
|
+
|
38
|
+
# A LF cannot be escaped with a backslash because a backslash + LF
|
39
|
+
# combo is regarded as line continuation and simply ignored.
|
40
|
+
str.gsub!(/\n/, "'\n'")
|
41
|
+
|
42
|
+
return str
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: j-cap-recipes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Nikitochkin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-02-
|
11
|
+
date: 2014-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -67,6 +67,7 @@ files:
|
|
67
67
|
- Rakefile
|
68
68
|
- j-cap-recipes.gemspec
|
69
69
|
- lib/j-cap-recipes.rb
|
70
|
+
- lib/j-cap-recipes/airbrake.rb
|
70
71
|
- lib/j-cap-recipes/check.rb
|
71
72
|
- lib/j-cap-recipes/database.rb
|
72
73
|
- lib/j-cap-recipes/delayed_job.rb
|
@@ -82,6 +83,7 @@ files:
|
|
82
83
|
- lib/j-cap-recipes/rails.rb
|
83
84
|
- lib/j-cap-recipes/rake.rb
|
84
85
|
- lib/j-cap-recipes/setup.rb
|
86
|
+
- lib/j-cap-recipes/tasks/airbrake.rake
|
85
87
|
- lib/j-cap-recipes/tasks/check.rake
|
86
88
|
- lib/j-cap-recipes/tasks/database.rake
|
87
89
|
- lib/j-cap-recipes/tasks/delayed_job.rake
|