sentry and xgo

pull/773/merge
hunterlong 2020-08-12 14:39:15 -07:00
parent b9cee7a796
commit 3ab3e71dcc
4 changed files with 17 additions and 4 deletions

View File

@ -330,9 +330,11 @@ valid-sign:
gpg --verify statping.asc
sentry-release:
sentry-cli releases new -p backend -p frontend v${VERSION}
sentry-cli releases set-commits --auto v${VERSION}
sentry-cli releases finalize v${VERSION}
sentry-cli releases --org statping new -p backend -p frontend v${VERSION}
sentry-cli releases --org statping set-commits v${VERSION} --auto
sentry-cli releases --org statping --project frontend files v${VERSION} upload ./frontend/dist
sentry-cli releases --org statping --project frontend files v${VERSION} upload-sourcemaps ./frontend/dist --no-sourcemap-reference
sentry-cli releases --org statping finalize v${VERSION}
download-bins: clean
mkdir build || true
@ -376,6 +378,9 @@ certs:
-keyout key.pem \
-subj "/C=US/ST=California/L=Santa Monica/O=Statping/OU=Development/CN=localhost"
xgo-latest:
xgo --go $(GOVERSION) --targets=linux/amd64,linux/386,linux/arm-7,linux/arm-6,linux/arm64,windows/386,windows/amd64,darwin/386,darwin/amd64 --out='statping' --pkg='cmd' --dest=build --tags 'netgo' --ldflags='-X main.VERSION=${VERSION} -X main.COMMIT=$(COMMIT) -linkmode external -extldflags "-static"' .
buildx-latest: multiarch
docker buildx create --name statping-latest
docker buildx inspect --builder statping-latest --bootstrap
@ -409,5 +414,10 @@ check:
@echo "yarn: $(shell yarn --version) - $(shell which yarn)" && yarn --version >/dev/null 2>&1 || (echo "ERROR: yarn is required."; exit 1)
@echo "All required programs are installed!"
#sentry-release:
# sentry-cli releases new -p $SENTRY_PROJECT $VERSION
# sentry-cli releases set-commits --auto $VERSION
# sentry-cli releases files $VERSION upload-sourcemaps dist
.PHONY: all check build certs multiarch install-darwin go-build build-all buildx-base buildx-dev buildx-latest build-alpine test-all test test-api docker frontend up down print_details lite sentry-release snapcraft build-linux build-mac build-win build-all postman
.SILENT: travis_s3_creds

1
go.mod
View File

@ -5,6 +5,7 @@ go 1.14
require (
github.com/GeertJohan/go.rice v1.0.0
github.com/crazy-max/xgo v0.4.0 // indirect
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/fatih/structs v1.1.0
github.com/foomo/simplecert v1.7.5

2
go.sum
View File

@ -136,6 +136,8 @@ github.com/cpu/goacmedns v0.0.2/go.mod h1:4MipLkI+qScwqtVxcNO6okBhbgRrr7/tKXUSgS
github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
github.com/crazy-max/xgo v0.4.0 h1:bKZV/6azR3Fldy/18U7ymnRV9az+Vt/T+09xlWKjW6Q=
github.com/crazy-max/xgo v0.4.0/go.mod h1:9sA9qZWLR9koBkgNTcktix7/MVbYrLWNnIQvYYq6/DA=
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
github.com/daaku/go.zipexe v1.0.0 h1:VSOgZtH418pH9L16hC/JrgSNJbbAL26pj7lmD1+CGdY=
github.com/daaku/go.zipexe v1.0.0/go.mod h1:z8IiR6TsVLEYKwXAoE/I+8ys/sDkgTzSL0CLnGVd57E=

View File

@ -40,7 +40,7 @@ func SentryInit(v *string, allow bool) {
}
goEnv := Params.GetString("GO_ENV")
allowReports := Params.GetBool("ALLOW_REPORTS")
if allowReports || allow || goEnv == "test" {
if allow || goEnv == "test" || allowReports {
if err := sentry.Init(sentry.ClientOptions{
Dsn: errorReporter,
Environment: goEnv,