mirror of
https://github.com/ManyakRus/starter.git
synced 2025-11-26 23:10:42 +02:00
сделал Show_Version()
This commit is contained in:
4
Makefile
4
Makefile
@@ -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
1
make_version.sh
Executable 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
11
pkg/version/version.go
Normal 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
1
pkg/version/version.txt
Normal file
@@ -0,0 +1 @@
|
||||
v1.0.61 2024-10-14 14:25:20 +0300
|
||||
12
pkg/version/version_test.go
Normal file
12
pkg/version/version_test.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package version
|
||||
|
||||
import (
|
||||
"github.com/ManyakRus/starter/micro"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestShow_Version(t *testing.T) {
|
||||
|
||||
micro.Show_Version(Version)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user