Add Sentry Release Reporting (attempt 2)

This commit is contained in:
Runebaas 2019-03-02 02:06:46 -05:00
parent 809adee778
commit 3a6dd8ea10
No known key found for this signature in database
GPG key ID: 2677AF508D0300D6
2 changed files with 6 additions and 3 deletions

View file

@ -23,13 +23,16 @@ build:
sentry: sentry:
stage: ops stage: ops
image: getsentry/sentry-cli image: getsentry/sentry-cli
variables:
VERSION: 4.0.0-${CI_COMMIT_SHA:0:8}
only: only:
- master - master
dependencies: dependencies:
- build - build
script: script:
- sentry-cli releases new -p geekbot 4.0.0-${CI_COMMIT_SHA:0:8} - sentry-cli releases new -p geekbot $VERSION
- sentry-cli releases set-commits --auto 4.0.0-${CI_COMMIT_SHA:0:8} - sentry-cli releases set-commits --auto $VERSION
- sentry-cli releases deploys $VERSION new -e Production
deploy: deploy:
stage: deploy stage: deploy

View file

@ -28,7 +28,7 @@ namespace Geekbot.net.Lib.ErrorHandling
var sentryDsn = Environment.GetEnvironmentVariable("SENTRY"); var sentryDsn = Environment.GetEnvironmentVariable("SENTRY");
if (!string.IsNullOrEmpty(sentryDsn)) if (!string.IsNullOrEmpty(sentryDsn))
{ {
_raven = new RavenClient(sentryDsn) { Release = Constants.BotVersion() }; _raven = new RavenClient(sentryDsn) { Release = Constants.BotVersion(), Environment = "Production" };
_logger.Information(LogSource.Geekbot, $"Command Errors will be logged to Sentry: {sentryDsn}"); _logger.Information(LogSource.Geekbot, $"Command Errors will be logged to Sentry: {sentryDsn}");
} }
else else