Remove branch from version info
When travis builds a tag, no branch is set
This commit is contained in:
parent
fb6bb484a4
commit
66a7c3ee47
4
app.go
4
app.go
|
|
@ -21,12 +21,10 @@ var (
|
||||||
Commit = "unknown"
|
Commit = "unknown"
|
||||||
// BuildDate the date on which this binary was build.
|
// BuildDate the date on which this binary was build.
|
||||||
BuildDate = "unknown"
|
BuildDate = "unknown"
|
||||||
// Branch the git branch of this version.
|
|
||||||
Branch = "unknown"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
vInfo := &model.VersionInfo{Version: Version, Commit: Commit, BuildDate: BuildDate, Branch: Branch}
|
vInfo := &model.VersionInfo{Version: Version, Commit: Commit, BuildDate: BuildDate}
|
||||||
|
|
||||||
fmt.Println("Starting Gotify version", vInfo.Version+"@"+BuildDate)
|
fmt.Println("Starting Gotify version", vInfo.Version+"@"+BuildDate)
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -1169,10 +1169,6 @@
|
||||||
"description": "VersionInfo Model",
|
"description": "VersionInfo Model",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
"branch": {
|
|
||||||
"type": "string",
|
|
||||||
"x-go-name": "Branch"
|
|
||||||
},
|
|
||||||
"buildDate": {
|
"buildDate": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"x-go-name": "BuildDate"
|
"x-go-name": "BuildDate"
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,5 @@ type VersionInfo struct {
|
||||||
Version string `json:"version"`
|
Version string `json:"version"`
|
||||||
Commit string `json:"commit"`
|
Commit string `json:"commit"`
|
||||||
BuildDate string `json:"buildDate"`
|
BuildDate string `json:"buildDate"`
|
||||||
Branch string `json:"branch"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ func (s *IntegrationSuite) BeforeTest(string, string) {
|
||||||
var err error
|
var err error
|
||||||
s.db, err = database.New("sqlite3", "itest.db", "admin", "pw", 5)
|
s.db, err = database.New("sqlite3", "itest.db", "admin", "pw", 5)
|
||||||
assert.Nil(s.T(), err)
|
assert.Nil(s.T(), err)
|
||||||
g, closable := Create(s.db, &model.VersionInfo{Version:"1.0.0", BuildDate:"2018-02-20-17:30:47", Branch:"master", Commit:"asdasds"}, &config.Configuration{PassStrength:5})
|
g, closable := Create(s.db, &model.VersionInfo{Version:"1.0.0", BuildDate:"2018-02-20-17:30:47", Commit:"asdasds"}, &config.Configuration{PassStrength:5})
|
||||||
s.closable = closable
|
s.closable = closable
|
||||||
s.server = httptest.NewServer(g)
|
s.server = httptest.NewServer(g)
|
||||||
}
|
}
|
||||||
|
|
@ -54,7 +54,7 @@ func (s *IntegrationSuite) AfterTest(string, string) {
|
||||||
func (s *IntegrationSuite) TestVersionInfo() {
|
func (s *IntegrationSuite) TestVersionInfo() {
|
||||||
req := s.newRequest("GET", "version", "")
|
req := s.newRequest("GET", "version", "")
|
||||||
|
|
||||||
doRequestAndExpect(s.T(), req, 200, `{"version":"1.0.0", "commit":"asdasds", "buildDate":"2018-02-20-17:30:47", "branch":"master"}`)
|
doRequestAndExpect(s.T(), req, 200, `{"version":"1.0.0", "commit":"asdasds", "buildDate":"2018-02-20-17:30:47"}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *IntegrationSuite) TestSendMessage() {
|
func (s *IntegrationSuite) TestSendMessage() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue