From 1545fe2508523f9273a3e8441422379abfc77b9a Mon Sep 17 00:00:00 2001 From: Anton Kuznetcov Date: Tue, 28 Oct 2025 14:52:55 +0600 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=B2=D0=B5=D1=82=D0=BA?= =?UTF-8?q?=D0=B5=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- VERSION.txt | 2 +- deploy/VERSION.txt | 2 +- kustomize/configmap.yaml | 2 +- kustomize/deployment.yaml | 4 ++-- kustomize/kustomization.yaml | 4 ++-- main.go | 17 +++++++++-------- 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/VERSION.txt b/VERSION.txt index c2f6de9..d8ba80f 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -v2.0.5 +v2.0.7 diff --git a/deploy/VERSION.txt b/deploy/VERSION.txt index c2f6de9..d8ba80f 100644 --- a/deploy/VERSION.txt +++ b/deploy/VERSION.txt @@ -1 +1 @@ -v2.0.5 +v2.0.7 diff --git a/kustomize/configmap.yaml b/kustomize/configmap.yaml index 0b6da9f..8ea53de 100644 --- a/kustomize/configmap.yaml +++ b/kustomize/configmap.yaml @@ -5,7 +5,7 @@ metadata: namespace: lcg data: # Основные настройки - LCG_VERSION: "v2.0.5" + LCG_VERSION: "v2.0.7" LCG_BASE_PATH: "/lcg" LCG_SERVER_HOST: "0.0.0.0" LCG_SERVER_PORT: "8080" diff --git a/kustomize/deployment.yaml b/kustomize/deployment.yaml index fa01ef5..228e48f 100644 --- a/kustomize/deployment.yaml +++ b/kustomize/deployment.yaml @@ -5,7 +5,7 @@ metadata: namespace: lcg labels: app: lcg - version: v2.0.5 + version: v2.0.7 spec: replicas: 1 selector: @@ -18,7 +18,7 @@ spec: spec: containers: - name: lcg - image: kuznetcovay/lcg:v2.0.5 + image: kuznetcovay/lcg:v2.0.7 imagePullPolicy: Always ports: - containerPort: 8080 diff --git a/kustomize/kustomization.yaml b/kustomize/kustomization.yaml index f45c11f..6860444 100644 --- a/kustomize/kustomization.yaml +++ b/kustomize/kustomization.yaml @@ -15,11 +15,11 @@ resources: # Common labels # commonLabels: # app: lcg -# version: v2.0.5 +# version: v2.0.7 # managed-by: kustomize # Images # images: # - name: lcg # newName: kuznetcovay/lcg -# newTag: v2.0.5 +# newTag: v2.0.7 diff --git a/main.go b/main.go index be28cac..114314f 100644 --- a/main.go +++ b/main.go @@ -156,9 +156,12 @@ lcg [опции] <описание команды> Debug: c.Bool("debug"), } disableHistory = config.AppConfig.MainFlags.NoHistory || config.AppConfig.IsNoHistoryEnabled() - + config.AppConfig.MainFlags.Debug = config.AppConfig.MainFlags.Debug || config.GetEnvBool("LCG_DEBUG", false) - + + fmt.Println("Debug:", config.AppConfig.MainFlags.Debug) + fmt.Println("LCG_DEBUG:", config.GetEnvBool("LCG_DEBUG", false)) + args := c.Args().Slice() if len(args) == 0 { @@ -178,7 +181,7 @@ lcg [опции] <описание команды> } } - if CompileConditions.NoServe { + if CompileConditions.NoServe { if len(args) > 1 && args[0] == "serve" { printColored("❌ Error: serve command is disabled in this build\n", colorRed) os.Exit(1) @@ -569,11 +572,9 @@ func getCommands() []*cli.Command { host := c.String("host") openBrowser := c.Bool("browser") - // Пробрасываем глобальный флаг debug для web-сервера - // Позволяет запускать: lcg -d serve -p ... - if c.Bool("debug") { - config.AppConfig.MainFlags.Debug = true - } + // Пробрасываем debug: флаг или переменная окружения LCG_DEBUG + // Позволяет запускать: LCG_DEBUG=1 lcg serve ... или lcg -d serve ... + config.AppConfig.MainFlags.Debug = c.Bool("debug") || config.GetEnvBool("LCG_DEBUG", false) // Обновляем конфигурацию сервера с новыми параметрами config.AppConfig.Server.Host = host