Skip to content

Commit

Permalink
Merge pull request #8 from depot/sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie authored Mar 22, 2022
2 parents 10d8564 + 787e330 commit f8e3c9c
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ builds:
binary: bin/depot
main: ./cmd/depot
ldflags:
- -s -w -X github.com/depot/cli/internal/build.Version={{.Version}} -X github.com/depot/cli/internal/build.Date={{time "2006-01-02"}}
- -s -w -X github.com/depot/cli/internal/build.Version={{.Version}} -X github.com/depot/cli/internal/build.Date={{time "2006-01-02"}} -X github.com/depot/cli/internal/build.SentryEnvironment=release
- -X main.updaterEnabled=depot/cli
id: macos
goos: [darwin]
Expand Down
13 changes: 13 additions & 0 deletions cmd/depot/main.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package main

import (
"log"
"os"

"github.com/depot/cli/internal/build"
"github.com/depot/cli/pkg/cmd/root"
"github.com/getsentry/sentry-go"
)

func main() {
Expand All @@ -13,6 +15,17 @@ func main() {
}

func runMain() int {
if os.Getenv("DEPOT_ERROR_TELEMETRY") != "0" {
err := sentry.Init(sentry.ClientOptions{
Dsn: "https://[email protected]/6271909",
Environment: build.SentryEnvironment,
Release: build.Version,
})
if err != nil {
log.Fatalf("sentry.Init: %s", err)
}
}

buildVersion := build.Version
buildDate := build.Date

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ require (
github.com/docker/distribution v2.8.0+incompatible
github.com/docker/docker v20.10.7+incompatible
github.com/docker/go-units v0.4.0
github.com/getsentry/sentry-go v0.13.0
github.com/moby/buildkit v0.10.0-rc2.0.20220308185020-fdecd0ae108b
github.com/morikuni/aec v1.0.0
github.com/pkg/errors v0.9.1
Expand Down
Loading

0 comments on commit f8e3c9c

Please sign in to comment.