1
0
mirror of https://github.com/ManyakRus/starter.git synced 2025-11-26 23:10:42 +02:00

сделал Show_Version()

This commit is contained in:
Nikitin Aleksandr
2024-10-15 11:27:55 +03:00
parent 8d72ad6398
commit 0527914ab5
5 changed files with 29 additions and 0 deletions

View File

@@ -9,17 +9,20 @@ NEW_REPO=github.com/ManyakRus/starter
run:
clear
./make_version.sh
go build -race -o $(FILEAPP) $(FILEMAIN)
# cd ./bin && \
./bin/app_race
mod:
clear
./make_version.sh
go get -u ./...
go mod tidy -compat=1.22
go mod vendor
go fmt ./...
build:
clear
./make_version.sh
go build -race -o $(FILEAPP) $(FILEMAIN)
cd ./cmd && \
./VersionToFile.py
@@ -46,6 +49,7 @@ conn:
image_connections ./ docs/connections.graphml $(SERVICENAME)
lines:
clear
./make_version.sh
go_lines_count ./ ./docs/lines_count.txt 10
licenses:
golicense -out-xlsx=./docs/licenses.xlsx $(FILEAPP)

1
make_version.sh Executable file
View File

@@ -0,0 +1 @@
echo $(git describe --tags $(git rev-parse HEAD)) $(git show --no-patch --format=%ci) >./pkg/version/version.txt

11
pkg/version/version.go Normal file
View File

@@ -0,0 +1,11 @@
package version
import _ "embed"
// Version - версия приложения из git, заполняется при компиляции программы
// из файла version.txt
// для обновления версии запустите
// make_version.sh
//
//go:embed version.txt
var Version string

1
pkg/version/version.txt Normal file
View File

@@ -0,0 +1 @@
v1.0.61 2024-10-14 14:25:20 +0300

View File

@@ -0,0 +1,12 @@
package version
import (
"github.com/ManyakRus/starter/micro"
"testing"
)
func TestShow_Version(t *testing.T) {
micro.Show_Version(Version)
}