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