capistrano-newrelic 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +41 -20
- data/lib/capistrano/newrelic.rb +1 -3
- data/lib/capistrano/newrelic/version.rb +1 -1
- data/lib/capistrano/tasks/{newrelic.cap → newrelic.rake} +16 -10
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a27d1d807e082fe33ef02638c99431933150802
|
4
|
+
data.tar.gz: d7a3aa958ea58f9ac31407b4b670089fa4988634
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1c60abc55b87c0a5a23567c1b513ac79e69dfe38efccfae88dbfca7a344bfc2ddcbbdd2203ae1fa9df4bf653bfcbb0c6d20bcd4cb1c8c9825610812d0dbb16d
|
7
|
+
data.tar.gz: 0bb3f4b9dfa3ea627d95a2b5085e7e349e5340c0070166162359c02c51086a017811f3cc7474adf9e27c6d2c5c2f2c38a84057606f4c97aaec8980516666b686
|
data/README.md
CHANGED
@@ -16,47 +16,68 @@ Or install it yourself as:
|
|
16
16
|
$ gem install capistrano-newrelic
|
17
17
|
|
18
18
|
## Usage
|
19
|
-
# Capfile
|
20
19
|
|
21
|
-
|
20
|
+
#### In Capfile
|
22
21
|
|
23
|
-
|
22
|
+
require 'capistrano/newrelic'
|
23
|
+
|
24
|
+
#### In stage files
|
25
|
+
|
26
|
+
In your Capfile, or stage configuration files for multi-stage configuration add:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
before 'deploy:finished', 'newrelic:notice_deployment'
|
30
|
+
```
|
31
|
+
License key and application name are retrieved from `config/newrelic.yml` based
|
32
|
+
on the environment setting (defaults to value of `rails_env`,
|
33
|
+
`rack_env` and can be overridden by setting `newrelic_env`).
|
34
|
+
|
35
|
+
#### In deploy.rb
|
24
36
|
|
25
37
|
Configurable options, shown here with defaults:
|
26
38
|
|
39
|
+
```ruby
|
27
40
|
# New Relic environment to deploy to. Sets config based on section of newrelic.yml
|
28
41
|
set :newrelic_env, fetch(:stage, fetch(:rack_env, fetch(:rails_env, 'production')))
|
29
|
-
|
30
|
-
|
42
|
+
|
43
|
+
# Deployment changelog defaults to the git changelog, if using git
|
44
|
+
set :newrelic_changelog, "<git changelog if available>"
|
45
|
+
|
31
46
|
# Deployment description
|
32
47
|
set :newrelic_desc, ""
|
48
|
+
|
33
49
|
# Deploy user if set will be used instead of the VCS user.
|
34
50
|
set :newrelic_deploy_user
|
51
|
+
```
|
35
52
|
|
36
53
|
## Changelog
|
37
|
-
0.0.8:
|
38
|
-
- Hook was removed, please set it in your deploy.rb or deploy/'stage'.rb
|
39
54
|
|
55
|
+
0.0.9:
|
56
|
+
* Added changelog capture for git
|
57
|
+
* Populate revision with `current_revision` from scm if available;
|
58
|
+
i.e., the git SHA
|
40
59
|
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
60
|
+
0.0.8:
|
61
|
+
* Hook was removed, please set it in your deploy.rb or deploy/'stage'.rb
|
62
|
+
```ruby
|
63
|
+
before 'deploy:finished', 'newrelic:notice_deployment'
|
64
|
+
```
|
65
|
+
|
66
|
+
* Revision can be set with :
|
67
|
+
```ruby
|
68
|
+
set :newrelic_revision, "Your text here"
|
69
|
+
```
|
70
|
+
or
|
71
|
+
```ruby
|
72
|
+
$ NEWRELIC_REVISION='Your text here' bundle exe cap ....
|
73
|
+
```
|
54
74
|
|
55
75
|
## Contributors
|
56
76
|
|
57
77
|
- [Bryan Ricker] (https://github.com/bricker)
|
58
78
|
- [James Kahn] (https://github.com/jisk)
|
59
79
|
- [Wojciech Wnętrzak] (https://github.com/morgoth)
|
80
|
+
- [Bill Kayser (New Relic)] (https://github.com/bkayser)
|
60
81
|
|
61
82
|
## Contributing
|
62
83
|
|
data/lib/capistrano/newrelic.rb
CHANGED
@@ -1,19 +1,24 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
set :newrelic_env, fetch(:stage, fetch(:rack_env, fetch(:rails_env, fetch(:stage))))
|
4
|
-
set :_newrelic_revision, -> { ENV['NEWRELIC_REVISION'] || fetch(:newrelic_revision, release_timestamp.strip) }
|
5
|
-
end
|
6
|
-
end
|
1
|
+
require 'newrelic_rpm'
|
2
|
+
require 'new_relic/cli/command'
|
7
3
|
|
8
4
|
namespace :newrelic do
|
9
5
|
desc "Record a deployment in New Relic (newrelic.com)"
|
10
6
|
task :notice_deployment do
|
11
7
|
set :newrelic_appname, fetch(:application)
|
8
|
+
changelog = fetch :newrelic_changelog
|
9
|
+
if changelog.nil? && fetch(:scm) == :git
|
10
|
+
on primary(:app) do
|
11
|
+
within repo_path do
|
12
|
+
changelog = capture(:git, "log --no-color --pretty=format:'* %an: %s' --abbrev-commit --no-merges #{fetch(:previous_revision)[/^.*$/]}..#{fetch(:current_revision)}")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
12
17
|
run_locally do
|
13
18
|
deploy_options = {
|
14
|
-
:environment => fetch(:newrelic_env),
|
15
|
-
:revision => fetch(:
|
16
|
-
:changelog =>
|
19
|
+
:environment => fetch(:newrelic_env, fetch(:stage, fetch(:rack_env, fetch(:rails_env, fetch(:stage))))),
|
20
|
+
:revision => ENV['NEWRELIC_REVISION'] || fetch(:newrelic_revision, fetch(:current_revision, release_timestamp.strip)),
|
21
|
+
:changelog => changelog,
|
17
22
|
:description => fetch(:newrelic_desc),
|
18
23
|
:user => fetch(:newrelic_deploy_user)
|
19
24
|
}
|
@@ -24,7 +29,7 @@ namespace :newrelic do
|
|
24
29
|
git_user = capture('git config user.name', raise_on_non_zero_exit: false).strip
|
25
30
|
deploy_options[:user] = git_user unless git_user.empty?
|
26
31
|
else
|
27
|
-
|
32
|
+
deploy_options[:user] = ENV['USER']
|
28
33
|
end
|
29
34
|
end
|
30
35
|
|
@@ -40,3 +45,4 @@ namespace :newrelic do
|
|
40
45
|
end
|
41
46
|
end
|
42
47
|
end
|
48
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-newrelic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Abdelkader Boudih
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-03-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|
@@ -54,7 +54,7 @@ files:
|
|
54
54
|
- lib/capistrano-newrelic.rb
|
55
55
|
- lib/capistrano/newrelic.rb
|
56
56
|
- lib/capistrano/newrelic/version.rb
|
57
|
-
- lib/capistrano/tasks/newrelic.
|
57
|
+
- lib/capistrano/tasks/newrelic.rake
|
58
58
|
homepage: https://github.com/seuros/capistrano-newrelic
|
59
59
|
licenses:
|
60
60
|
- MIT
|
@@ -75,7 +75,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
75
75
|
version: '0'
|
76
76
|
requirements: []
|
77
77
|
rubyforge_project:
|
78
|
-
rubygems_version: 2.
|
78
|
+
rubygems_version: 2.4.5
|
79
79
|
signing_key:
|
80
80
|
specification_version: 4
|
81
81
|
summary: New Relic integration for Capistrano
|