Remove branch from version info

When travis builds a tag, no branch is set
This commit is contained in:
Jannis Mattheis 2018-02-24 10:58:59 +01:00 committed by Jannis Mattheis
parent fb6bb484a4
commit 66a7c3ee47
5 changed files with 4 additions and 11 deletions

4
app.go
View File

@ -21,12 +21,10 @@ var (
Commit = "unknown"
// BuildDate the date on which this binary was build.
BuildDate = "unknown"
// Branch the git branch of this version.
Branch = "unknown"
)
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)
rand.Seed(time.Now().UnixNano())

File diff suppressed because one or more lines are too long

View File

@ -1169,10 +1169,6 @@
"description": "VersionInfo Model",
"type": "object",
"properties": {
"branch": {
"type": "string",
"x-go-name": "Branch"
},
"buildDate": {
"type": "string",
"x-go-name": "BuildDate"

View File

@ -7,6 +7,5 @@ type VersionInfo struct {
Version string `json:"version"`
Commit string `json:"commit"`
BuildDate string `json:"buildDate"`
Branch string `json:"branch"`
}

View File

@ -39,7 +39,7 @@ func (s *IntegrationSuite) BeforeTest(string, string) {
var err error
s.db, err = database.New("sqlite3", "itest.db", "admin", "pw", 5)
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.server = httptest.NewServer(g)
}
@ -54,7 +54,7 @@ func (s *IntegrationSuite) AfterTest(string, string) {
func (s *IntegrationSuite) TestVersionInfo() {
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() {