capistrano-sentry 0.1.5 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -2
- data/lib/capistrano/sentry/version.rb +1 -1
- data/lib/capistrano/tasks/sentry.rake +9 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c2b0c32362fb64aaaa1e3037835ddf4e8c57db855e4081f3be2777ed78c5082
|
4
|
+
data.tar.gz: 38c19a019f359db6dd0f12d6b9c17faa5a4d4c3e2d8137b1765a928e8a6155b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3ea7744d925f10e7930cae9c6793f2303cd34be0ac5821880462345f46fe10e90a94400987259b1c591e2f63440424ee8257ce162cf7c1998191b992157d4af
|
7
|
+
data.tar.gz: ecdec189a6ae9f5848171738c48bad136e381994ec3d99d1460a9827af5cb746290aec9eaca6c430a16024b8a1da62d5c16711cb8f20c2316e2df63e35d9853a
|
data/README.md
CHANGED
@@ -19,9 +19,11 @@ Then, add this line to your application's Capfile:
|
|
19
19
|
require 'capistrano/sentry'
|
20
20
|
```
|
21
21
|
|
22
|
-
And then execute:
|
22
|
+
And then execute from your command line:
|
23
23
|
|
24
|
-
|
24
|
+
```bash
|
25
|
+
bundle
|
26
|
+
```
|
25
27
|
|
26
28
|
## Usage
|
27
29
|
|
@@ -29,6 +31,7 @@ Add these lines to your application's `config/deploy.rb`:
|
|
29
31
|
|
30
32
|
```ruby
|
31
33
|
# Sentry deployment notification
|
34
|
+
set :sentry_host, 'https://my-sentry.mycorp.com' # https://sentry.io by default
|
32
35
|
set :sentry_api_token, 'd9fe44a1cf34e63993e258dbecf42158918d407978a1bb72f8fb5886aa5f9fe1'
|
33
36
|
set :sentry_organization, 'my-org' # fetch(:application) by default
|
34
37
|
set :sentry_project, 'my-proj' # fetch(:application) by default
|
@@ -1,39 +1,32 @@
|
|
1
1
|
# This task will notify Sentry via their API[1] that you have deployed
|
2
|
-
# a new release. It uses the
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# This task requires several environment variables be set (or just
|
6
|
-
# hardcode the values in here if you like living on the edge):
|
7
|
-
#
|
8
|
-
# ENV['SENTRY_API_ENDPOINT'] : API endpoint, https://app.getsentry.com
|
9
|
-
# ENV['SENTRY_ORG'] : the organization for this app
|
10
|
-
# ENV['SENTRY_PROJECT'] : the project for this app
|
11
|
-
# ENV['SENTRY_AUTH_TOKEN'] : a valid Auth token (replaces API Key)
|
2
|
+
# a new release. It uses the commit hash as the `version` and the git ref as
|
3
|
+
# the optional `ref` value.
|
12
4
|
#
|
13
5
|
# [1]: https://docs.getsentry.com/hosted/api/releases/post-project-releases
|
14
6
|
|
15
7
|
# For Rails app, this goes in config/deploy.rb
|
16
8
|
|
17
9
|
namespace :sentry do
|
18
|
-
desc 'Notice new deployment in Sentry
|
10
|
+
desc 'Notice new deployment in Sentry'
|
19
11
|
task :notice_deployment do
|
20
12
|
run_locally do
|
21
13
|
require 'uri'
|
22
14
|
require 'net/https'
|
23
15
|
require 'json'
|
24
16
|
|
25
|
-
uri = URI.parse('https://sentry.io')
|
26
|
-
http = Net::HTTP.new(uri.host, uri.port)
|
27
|
-
http.use_ssl = true
|
28
|
-
|
29
17
|
version = `git rev-parse HEAD`.strip
|
30
18
|
|
19
|
+
sentry_host = ENV['SENTRY_HOST'] || fetch(:sentry_host, 'https://sentry.io')
|
31
20
|
orga_slug = fetch(:sentry_organization) || fetch(:application)
|
32
21
|
project = fetch(:sentry_project) || fetch(:application)
|
33
22
|
environment = fetch(:stage) || 'default'
|
34
23
|
api_token = ENV['SENTRY_API_TOKEN'] || fetch(:sentry_api_token)
|
35
24
|
repo_name = fetch(:sentry_repo) || fetch(:repo_url).split(':').last.gsub(/\.git$/, '')
|
36
25
|
|
26
|
+
uri = URI.parse(sentry_host)
|
27
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
28
|
+
http.use_ssl = true
|
29
|
+
|
37
30
|
headers = {
|
38
31
|
'Content-Type' => 'application/json',
|
39
32
|
'Authorization' => 'Bearer ' + api_token.to_s
|
@@ -44,8 +37,7 @@ namespace :sentry do
|
|
44
37
|
version: version,
|
45
38
|
refs: [{
|
46
39
|
repository: repo_name,
|
47
|
-
commit: fetch(:current_revision) || `git rev-parse HEAD`.strip
|
48
|
-
# previousCommit: fetch(:previous_revision)
|
40
|
+
commit: fetch(:current_revision) || `git rev-parse HEAD`.strip
|
49
41
|
}],
|
50
42
|
projects: [project]
|
51
43
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capistrano-sentry
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brice Texier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|