Detailed version
All checks were successful
release-nightly / build-docker (push) Successful in 1m2s

This commit is contained in:
LittleSheep 2023-12-13 20:00:05 +08:00
parent 8f1ac85148
commit 0d8583e395
3 changed files with 17 additions and 4 deletions

View File

@ -3,7 +3,7 @@ FROM golang:alpine as roadsign-server
WORKDIR /source
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /dist ./pkg/cmd/server/main.go
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs -o /dist ./pkg/cmd/server/main.go
# Runtime
FROM golang:alpine

View File

@ -59,7 +59,8 @@ After that, you can manage your roadsign instance with RoadSign CLI aka. RDS CLI
To install it, run this command. (Make sure you have golang toolchain on your computer)
```shell
go install code.smartsheep.studio/goatworks/roadsign/pkg/cmd/rds@latest
go install -buildvcs code.smartsheep.studio/goatworks/roadsign/pkg/cmd/rds@latest
# Tips: Add `buildvsc` flag to provide more detail compatibility check.
```
## Usage

View File

@ -1,5 +1,17 @@
package roadsign
const (
AppVersion = "1.2.1"
import (
"runtime/debug"
)
func init() {
if info, ok := debug.ReadBuildInfo(); ok {
for _, setting := range info.Settings {
if setting.Key == "vcs.revision" {
AppVersion += "#" + setting.Value
}
}
}
}
var AppVersion = "1.2.1"