Skip to content

Commit 6a0ad5a

Browse files
committed
Clean code
1 parent e0f6869 commit 6a0ad5a

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

lib/capistrano/tasks/sentry.rake

+5-14
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
# 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.
124
#
135
# [1]: https://docs.getsentry.com/hosted/api/releases/post-project-releases
146

157
# For Rails app, this goes in config/deploy.rb
168

179
namespace :sentry do
18-
desc 'Notice new deployment in Sentry (sentry.io)'
10+
desc 'Notice new deployment in Sentry'
1911
task :notice_deployment do
2012
run_locally do
2113
require 'uri'
@@ -24,7 +16,7 @@ namespace :sentry do
2416

2517
version = `git rev-parse HEAD`.strip
2618

27-
sentry_host = ENV["SENTRY_HOST"] || fetch(:sentry_host, 'https://sentry.io')
19+
sentry_host = ENV['SENTRY_HOST'] || fetch(:sentry_host, 'https://sentry.io')
2820
orga_slug = fetch(:sentry_organization) || fetch(:application)
2921
project = fetch(:sentry_project) || fetch(:application)
3022
environment = fetch(:stage) || 'default'
@@ -45,8 +37,7 @@ namespace :sentry do
4537
version: version,
4638
refs: [{
4739
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
5041
}],
5142
projects: [project]
5243
)

0 commit comments

Comments
 (0)