Browse Source

update version code 更新版本号

pull/132/head
macbookpro 6 years ago
parent
commit
c02f2af4fe
  1. 12
      main.go
  2. 8
      package.json
  3. 2
      routers/sys.go
  4. 5
      routers/types.go

12
main.go

@ -17,6 +17,11 @@ import (
"github.com/penggy/service"
)
var (
gitCommitCode string
buildDateTime string
)
type program struct {
httpPort int
httpServer *http.Server
@ -128,13 +133,20 @@ func main() {
flag.StringVar(&utils.FlagVarConfFile, "config", "", "configure file path")
flag.Parse()
tail := flag.Args()
// log
log.SetPrefix("[EasyDarwin] ")
log.SetFlags(log.Lshortfile | log.LstdFlags)
if !utils.Debug {
log.Println("log files -->", utils.LogDir())
log.Printf("git commit code:%s", gitCommitCode)
log.Printf("build date:%s", buildDateTime)
log.SetOutput(utils.GetLogWriter())
}
log.Printf("git commit code:%s", gitCommitCode)
log.Printf("build date:%s", buildDateTime)
routers.BuildVersion = fmt.Sprintf("%s.%s", routers.BuildVersion, gitCommitCode)
routers.BuildDateTime = buildDateTime
sec := utils.Conf().Section("service")
svcConfig := &service.Config{

8
package.json

@ -7,9 +7,9 @@
"build:ico": "rsrc -arch amd64 -ico ed.ico -o EasyDarwin_windows.syso",
"build:www": "cd web_src && npm run build && cd .. && apidoc -i routers -o www/apidoc",
"build:doc": "apidoc -i routers -o www/apidoc",
"build:win": "go build -tags release -ldflags \"-s -w\" -o EasyDarwin.exe",
"build:lin": "go build -tags release -ldflags \"-s -w\" -o easydarwin",
"build:dev": "go build -o EasyDarwin.exe",
"build:win": "go build -tags release -ldflags \"-X 'main.buildDateTime=$(date '+%Y-%m-%d %H:%M:%S')' -X 'main.gitCommitCode=$(git rev-list --full-history --all --abbrev-commit --max-count 1)' -s -w\" -o EasyDarwin.exe",
"build:lin": "go build -tags release -ldflags \"-X 'main.buildDateTime=$(date '+%Y-%m-%d %H:%M:%S')' -X 'main.gitCommitCode=$(git rev-list --full-history --all --abbrev-commit --max-count 1)' -s -w\" -o easydarwin",
"build:dev": "go build -ldflags \"-X 'main.buildDateTime=$(date '+%Y-%m-%d %H:%M:%S')' -X 'main.gitCommitCode=$(git rev-list --full-history --all --abbrev-commit --max-count 1)'\" -o EasyDarwin.exe",
"dev": "gobuild -o EasyDarwin.exe",
"dev:lin": "gobuild -o easydarwin",
"dev:www": "cd web_src && npm run start",
@ -65,5 +65,5 @@
]
}
}
]
]
}

2
routers/sys.go

@ -113,7 +113,7 @@ func (h *APIHandler) GetServerInfo(c *gin.Context) {
"InterfaceVersion": "V1",
"RunningTime": utils.UpTimeString(),
"StartUpTime": utils.DateTime(utils.StartTime),
"Server": fmt.Sprintf("%s/%s (Platform/%s;)", "EasyDarwin", BuildVersion, strings.Title(runtime.GOOS)),
"Server": fmt.Sprintf("%s/%s,%s (Platform/%s;)", "EasyDarwin", BuildDateTime, BuildVersion, strings.Title(runtime.GOOS)),
"memData": memData,
"cpuData": cpuData,
"pusherData": pusherData,

5
routers/types.go

@ -2,9 +2,8 @@ package routers
import "github.com/penggy/EasyGoLib/utils"
const (
BuildVersion = "v8.1"
)
var BuildVersion = "v8.1"
var BuildDateTime = ""
type PercentData struct {
Time utils.DateTime `json:"time"`

Loading…
Cancel
Save