mirror of
https://github.com/elyby/chrly.git
synced 2024-11-26 16:51:59 +05:30
Добавлена генерация версии при сборке проекта
This commit is contained in:
parent
cf99a0eab2
commit
340b24d862
@ -38,7 +38,13 @@ build executable:
|
||||
<<: *setup_go_environment
|
||||
stage: build
|
||||
script:
|
||||
- env GOOS=linux go build -o $CI_PROJECT_DIR/minecraft-skinsystem main.go
|
||||
- export VERSION="${CI_BUILD_TAG:-dev-$CI_BUILD_REF_NAME-${CI_BUILD_REF:0:8}+build-$CI_BUILD_ID}"
|
||||
- >
|
||||
env GOOS=linux
|
||||
go build
|
||||
-o $CI_PROJECT_DIR/minecraft-skinsystem
|
||||
-ldflags "-X ${CI_PROJECT_NAMESPACE}/bootstrap.version=${VERSION}"
|
||||
main.go
|
||||
artifacts:
|
||||
name: "${CI_JOB_STAGE} executable"
|
||||
paths:
|
||||
|
@ -15,6 +15,12 @@ import (
|
||||
"elyby/minecraft-skinsystem/logger/receivers/sentry"
|
||||
)
|
||||
|
||||
var version = ""
|
||||
|
||||
func GetVersion() string {
|
||||
return version
|
||||
}
|
||||
|
||||
func CreateLogger(statsdAddr string, sentryAddr string) (wd.Watchdog, error) {
|
||||
wd.AddReceiver(ansi.New(true, true, false))
|
||||
if statsdAddr != "" {
|
||||
@ -38,9 +44,12 @@ func CreateLogger(statsdAddr string, sentryAddr string) (wd.Watchdog, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
ravenClient.SetRelease("1.3.2") // TODO: нужно как-то записывать версию во время билда
|
||||
ravenClient.SetEnvironment("production")
|
||||
ravenClient.SetDefaultLoggerName("sentry-watchdog-receiver")
|
||||
programVersion := GetVersion()
|
||||
if programVersion != "" {
|
||||
raven.SetRelease(programVersion)
|
||||
}
|
||||
|
||||
sentryReceiver, err := sentry.NewReceiverWithCustomRaven(ravenClient, &sentry.Config{
|
||||
MinLevel: "warn",
|
||||
|
Loading…
Reference in New Issue
Block a user