sentry: add a prefix to the release name

This commit is contained in:
Dawid Wysokiński 2021-11-10 08:11:35 +01:00
parent 67e0d349df
commit d8668c926d
Signed by: Kichiyaki
GPG Key ID: EF14026D247EB867
3 changed files with 8 additions and 4 deletions

View File

@ -40,7 +40,7 @@ jobs:
with:
context: .
build-args: |
VERSION=v${{ steps.get_version.outputs.VERSION }}
VERSION=${{ steps.get_version.outputs.VERSION }}
tags: |
${{ secrets.REGISTRY_NAME }}/zdam-egzamin-zawodowy-backend:latest
${{ secrets.REGISTRY_NAME }}/zdam-egzamin-zawodowy-backend:${{ steps.get_version.outputs.VERSION }}

View File

@ -11,7 +11,7 @@ RUN go mod download
# Copy the source from the current directory to the Working Directory inside the container
COPY ../.. .
ARG VERSION="v0.0.0"
ARG VERSION="0.0.0"
RUN apk --no-cache add musl-dev gcc build-base
RUN go generate ./...
RUN go build -ldflags="-X 'main.Version=$VERSION'" -o zdamegzawodowy ./cmd/server

View File

@ -7,11 +7,15 @@ import (
"os"
)
func InitSentry(release string) error {
const (
sentryAppName = "zdam-egzamin-zawodowy-backend"
)
func InitSentry(version string) error {
err := sentry.Init(sentry.ClientOptions{
Dsn: os.Getenv("SENTRY_DSN"),
Environment: appmode.Get(),
Release: release,
Release: sentryAppName + "@" + version,
Debug: false,
TracesSampleRate: 0.3,
})