1
1
# This task will notify Sentry via their API[1] that you have deployed
2
- # a new release. It uses the release timestamp as the `version`
3
- # (like 20151113182847) and the git ref as the optional `ref` value.
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 (sentry.io) '
10
+ desc 'Notice new deployment in Sentry'
19
11
task :notice_deployment do
20
12
run_locally do
21
13
require 'uri'
@@ -24,7 +16,7 @@ namespace :sentry do
24
16
25
17
version = `git rev-parse HEAD` . strip
26
18
27
- sentry_host = ENV [ " SENTRY_HOST" ] || fetch ( :sentry_host , 'https://sentry.io' )
19
+ sentry_host = ENV [ ' SENTRY_HOST' ] || fetch ( :sentry_host , 'https://sentry.io' )
28
20
orga_slug = fetch ( :sentry_organization ) || fetch ( :application )
29
21
project = fetch ( :sentry_project ) || fetch ( :application )
30
22
environment = fetch ( :stage ) || 'default'
@@ -45,8 +37,7 @@ namespace :sentry do
45
37
version : version ,
46
38
refs : [ {
47
39
repository : repo_name ,
48
- commit : fetch ( :current_revision ) || `git rev-parse HEAD` . strip ,
49
- # previousCommit: fetch(:previous_revision)
40
+ commit : fetch ( :current_revision ) || `git rev-parse HEAD` . strip
50
41
} ] ,
51
42
projects : [ project ]
52
43
)
0 commit comments