circleci_deployment_notifier 1.1.0 → 1.2.0

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: d33310b4336ae0ac91b9649691dbeaf7070569fe
4
- data.tar.gz: 4714fc08c4a00f01c33091d366975608687b27e9
3
+ metadata.gz: 623ab579691418aeeddac43ad98528a7b10eb6f8
4
+ data.tar.gz: 76eb2e378db4c6ed18e50aed82c4270714e71e1b
5
5
  SHA512:
6
- metadata.gz: 1818a8cdb6e29cd6d81a79fce46352bf208370e9a7619812599c27cf71bd4a36c089e42a508c9eb45916565cb6ef24a23c137cd6f0dd1e83d18e8fae5681715d
7
- data.tar.gz: 50969eaeef8bc73658c2d212addec59381f256e71ff00a0b493d2b9f10c03e02f8b0b54cf52979d5fa524e39eb9e768895cb32759f73d835683347692f69cece
6
+ metadata.gz: 37ad34ed733bdf8847e2fbfc513af88ba72776a90a4e20538f7083f4ef549ef6a07af85c2886f1a210e2f34a4be3745184e5200d62e6e0e122ed453bae5fd327
7
+ data.tar.gz: f8fb9fec57cff128db9b329be4e59545075e08045978f7828200c5d212353cf4c2981a7b179409bb6141ea4d116b050a0e1815204d0cddc53b61014f6554f2f7
data/README.md CHANGED
@@ -7,11 +7,15 @@
7
7
 
8
8
  Sends deployment notifications based on deployments that occur on CircleCI.
9
9
 
10
+ ![Deployment notifications on Slack](./images/slack-deployment-notifications.png)
11
+
12
+ ![Deployment indications on New Relic](./images/new-relic-deployments.png)
13
+
10
14
  Assumptions:
11
15
 
12
16
  - Using CircleCI.
13
17
  - Using Github.
14
- - Using Slack for notifications.
18
+ - Using Slack for notifications and/or using New Relic.
15
19
 
16
20
  You can also:
17
21
 
@@ -26,12 +30,13 @@ Add the following commands to your `circle.yml` deployment section:
26
30
  ```sh
27
31
  gem install circleci_deployment_notifier
28
32
  circleci_deployment_notify_slack -a "Application Name" -u "https://hooks.slack.com/services/WEBHOOK"
33
+ circleci_deployment_notify_new_relic -a "Application Name" --api-key "12345abcde" --app-id "12345678"
29
34
  ```
30
35
 
31
- It's best to use environment variables for sensitive information list Slack webhook URLs.
36
+ It's best to use environment variables for sensitive information such as Slack webhook URLs or API keys.
32
37
 
33
38
  So here's an example `circle.yml` deployment section that
34
- assumes you've set the environment variable `DEPLOYMENT_SLACK_WEBHOOK_URL`:
39
+ assumes you've set the environment variables `DEPLOYMENT_SLACK_WEBHOOK_URL` and `NEW_RELIC_API_KEY`:
35
40
  ```yml
36
41
  deployment:
37
42
  staging:
@@ -40,6 +45,7 @@ deployment:
40
45
  - # TODO: something to deploy the application to staging
41
46
  - gem install circleci_deployment_notifier
42
47
  - circleci_deployment_notify_slack -a "Application Staging" -u $DEPLOYMENT_SLACK_WEBHOOK_URL
48
+ - circleci_deployment_notify_new_relic -a "Application Staging" --api-key $NEW_RELIC_API_KEY --app-id "12345678"
43
49
  production:
44
50
  tag: /v[0-9]+\.[0-9]+\.[0-9]+/
45
51
  owner: MyOrganization
@@ -47,13 +53,31 @@ deployment:
47
53
  - # TODO: something to deploy the application to production
48
54
  - gem install circleci_deployment_notifier
49
55
  - circleci_deployment_notify_slack -a "Application Production" -u $DEPLOYMENT_SLACK_WEBHOOK_URL
56
+ - circleci_deployment_notify_new_relic -a "Application Production" --api-key $NEW_RELIC_API_KEY --app-id "87654321"
50
57
  ```
51
58
 
59
+ ### Tag Deploys
52
60
  That `production` section is designed to build and deploy for tags like "v1.0.0" that are created in
53
61
  the fork of the repo that belongs to MyOrganization.
54
62
  (So tags created in forks do not cause a build or deployment.)
55
63
  See [CircleCI docs](https://circleci.com/docs/configuration/#tags) for more info.
56
64
 
65
+ ### Slack Webhook
66
+
67
+ Create an Incoming Webhook service in Slack, and assign it the channel you want it to post.
68
+ If you want to post staging and production notifications to different Slack channels, you will need
69
+ to create different Webhooks for each.
70
+
71
+ ### New Relic
72
+
73
+ To get the New Relic App ID for each application, you must first have the application running and
74
+ reporting to New Relic.
75
+ This creates the application in New Relic and it will appear in the APM area of
76
+ [rpm.newrelic.com](https://rpm.newrelic.com).
77
+
78
+ Find the application in New Relic, and get the App ID from its URL.
79
+ The URL will look like `https://rpm.newrelic.com/accounts/<your_account_number>/applications/<app_id>`
80
+
57
81
  ## Development
58
82
 
59
83
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -20,6 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
+ spec.required_ruby_version = '~> 2.1'
23
24
  spec.add_development_dependency "bundler", "~> 1.13"
24
25
  spec.add_development_dependency "rake", "~> 12.0"
25
26
  spec.add_development_dependency "rspec", "~> 3.0"
@@ -48,7 +48,9 @@ module CircleciDeploymentNotifier
48
48
  end
49
49
 
50
50
  def repository_url
51
- ENV['CIRCLE_REPOSITORY_URL']
51
+ ENV['CIRCLE_REPOSITORY_URL'].sub(/\Agit@([-\.a-z]+):(.+)\.git\z/) { |m|
52
+ "https://#{$1}/#{$2}"
53
+ }
52
54
  end
53
55
 
54
56
  def build_identifier
@@ -1,3 +1,3 @@
1
1
  module CircleciDeploymentNotifier
2
- VERSION = "1.1.0".freeze
2
+ VERSION = "1.2.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: circleci_deployment_notifier
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robin Daugherty
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-15 00:00:00.000000000 Z
11
+ date: 2017-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -130,6 +130,8 @@ files:
130
130
  - circleci_deployment_notifier.gemspec
131
131
  - exe/circleci_deployment_notify_new_relic
132
132
  - exe/circleci_deployment_notify_slack
133
+ - images/new-relic-deployments.png
134
+ - images/slack-deployment-notifications.png
133
135
  - lib/circleci_deployment_notifier.rb
134
136
  - lib/circleci_deployment_notifier/build.rb
135
137
  - lib/circleci_deployment_notifier/build_info.rb
@@ -146,9 +148,9 @@ require_paths:
146
148
  - lib
147
149
  required_ruby_version: !ruby/object:Gem::Requirement
148
150
  requirements:
149
- - - ">="
151
+ - - "~>"
150
152
  - !ruby/object:Gem::Version
151
- version: '0'
153
+ version: '2.1'
152
154
  required_rubygems_version: !ruby/object:Gem::Requirement
153
155
  requirements:
154
156
  - - ">="
@@ -156,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
158
  version: '0'
157
159
  requirements: []
158
160
  rubyforge_project:
159
- rubygems_version: 2.6.8
161
+ rubygems_version: 2.5.1
160
162
  signing_key:
161
163
  specification_version: 4
162
164
  summary: Sends deployment notifications based on deployments that occur on CircleCI.