-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2918 from owncloud/ocs-version-update
[full-ci] Set OCS version to up to date values
- Loading branch information
Showing
10 changed files
with
81 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Enhancement: Product field in OCS version | ||
|
||
We've added a new field to the OCS Version, which is supposed to announce the product name. The web ui as a client will make use of it to make the backend product and version available (e.g. for easier bug reports). | ||
|
||
https://github.com/owncloud/ocis/pull/2918 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,52 @@ | ||
package version | ||
|
||
import ( | ||
"strconv" | ||
"time" | ||
|
||
"github.com/Masterminds/semver" | ||
) | ||
|
||
var ( | ||
// String gets defined by the build system. | ||
String = "0.0.0" | ||
String = "dev" | ||
|
||
// Date indicates the build date. | ||
Date = "00000000" | ||
Date = time.Now().Format("20060102") | ||
) | ||
|
||
// Compiled returns the compile time of this service. | ||
func Compiled() time.Time { | ||
t, _ := time.Parse("20060102", Date) | ||
return t | ||
} | ||
|
||
// GetString returns a version string with pre-releases and metadata | ||
func GetString() string { | ||
return Parsed().String() | ||
} | ||
|
||
// Parsed returns a semver Version | ||
func Parsed() *semver.Version { | ||
versionToParse := String | ||
if String == "dev" { | ||
versionToParse = "0.0.0+dev" | ||
} | ||
parsedVersion, err := semver.NewVersion(versionToParse) | ||
// We have no semver version but a commitid | ||
if err != nil { | ||
parsedVersion, err = semver.NewVersion("0.0.0+" + String) | ||
// this should never happen | ||
if err != nil { | ||
return &semver.Version{} | ||
} | ||
} | ||
return parsedVersion | ||
} | ||
|
||
// Long returns the legacy version with 4 number parts like 10.9.8.0 | ||
func Long() string { | ||
return strconv.FormatInt(Parsed().Major(), 10) + "." + | ||
strconv.FormatInt(Parsed().Minor(), 10) + "." + | ||
strconv.FormatInt(Parsed().Patch(), 10) + "." + "0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters