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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9bbe78f99bdc9faf872027cca29ed3cec82e03e3
4
- data.tar.gz: 7cd3fa2c3c9d377cc474c1f2db5465e2fee68cb9
3
+ metadata.gz: 8a27d1d807e082fe33ef02638c99431933150802
4
+ data.tar.gz: d7a3aa958ea58f9ac31407b4b670089fa4988634
5
5
  SHA512:
6
- metadata.gz: 3038303dd9645fa41b9b27fe4293aaa244252888c0533968ee110beb0cab7ca5a93bfcfd50e5fe5fe1fa3b7baa8620d0657f34521c2b61aaa073bdfd71aeed6d
7
- data.tar.gz: 38c4e7c67bd6730bf4cb2f468131cc5a4abb18130beb804a2e4620c3edee0e705c3308637a419b0a52a86f4b8a9cfe1bc9c044405c50594a0a2ada1ee46667b9
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
- require 'capistrano/newrelic'
20
+ #### In Capfile
22
21
 
23
- License key and application name are retrieved from newrelic.yml.
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
- # Deployment changelog
30
- set :newrelic_changelog, ""
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
- namespace :deploy do
42
- before :finished, 'newrelic:notice_deployment'
43
- end
44
-
45
- - Revision can be set with :
46
-
47
-
48
- set :newrelic_revision, "Your text here"
49
-
50
- or
51
-
52
- $ NEWRELIC_REVISION='Your text here' bundle exe cap ....
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
 
@@ -1,3 +1 @@
1
- require 'newrelic_rpm'
2
- require 'new_relic/cli/command'
3
- load File.expand_path('../tasks/newrelic.cap', __FILE__)
1
+ load File.expand_path("../tasks/newrelic.rake", __FILE__)
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module NewRelic
3
- VERSION = '0.0.8'
3
+ VERSION = '0.0.9'
4
4
  end
5
5
  end
@@ -1,19 +1,24 @@
1
- namespace :load do
2
- task :defaults do
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(:_newrelic_revision),
16
- :changelog => fetch(:newrelic_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
- debug '[Capistrano-newrelic] : Unsupported SCM , user not set. Please set :newrelic_deploy_user'
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.8
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: 2014-03-02 00:00:00.000000000 Z
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.cap
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.0.3
78
+ rubygems_version: 2.4.5
79
79
  signing_key:
80
80
  specification_version: 4
81
81
  summary: New Relic integration for Capistrano