mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2025-12-23 22:29:59 -05:00
fix: correct daily version
This commit is contained in:
15
.make/go.mk
15
.make/go.mk
@@ -18,21 +18,20 @@ SOURCES ?= $(shell find . -name "*.go" -type f -not -path "./node_modules/*")
|
||||
TAGS ?=
|
||||
|
||||
ifndef OUTPUT
|
||||
ifneq ($(DRONE_TAG),)
|
||||
OUTPUT ?= $(subst v,,$(DRONE_TAG))
|
||||
ifneq ($(CI_COMMIT_TAG),)
|
||||
OUTPUT ?= $(subst v,,$(CI_COMMIT_TAG))
|
||||
else
|
||||
OUTPUT ?= testing
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef VERSION
|
||||
ifneq ($(DRONE_TAG),)
|
||||
VERSION ?= $(subst v,,$(DRONE_TAG))
|
||||
else
|
||||
STRING ?= $(shell git rev-parse --short HEAD)
|
||||
endif
|
||||
ifeq ($(VERSION), daily)
|
||||
STRING ?= $(shell git rev-parse --short HEAD)
|
||||
else ifeq ($(VERSION),)
|
||||
STRING ?= $(shell git rev-parse --short HEAD)
|
||||
endif
|
||||
|
||||
|
||||
ifndef DATE
|
||||
DATE := $(shell date -u '+%Y%m%d')
|
||||
endif
|
||||
|
||||
@@ -46,18 +46,17 @@ func GetString() string {
|
||||
// Parsed returns a semver Version
|
||||
func Parsed() (version *semver.Version) {
|
||||
versionToParse := LatestTag
|
||||
if Tag != "" {
|
||||
// use the placeholder version if the tag is empty or when we are creating a daily build
|
||||
if Tag != "" && Tag != "daily" {
|
||||
versionToParse = Tag
|
||||
}
|
||||
version, err := semver.NewVersion(versionToParse)
|
||||
// We have no semver version but a commitid
|
||||
if err != nil {
|
||||
// this should never happen
|
||||
if err != nil {
|
||||
return &semver.Version{}
|
||||
}
|
||||
return &semver.Version{}
|
||||
}
|
||||
if String != "" {
|
||||
// We have no tagged version but a commitid
|
||||
nVersion, err := version.SetMetadata(String)
|
||||
if err != nil {
|
||||
return &semver.Version{}
|
||||
|
||||
Reference in New Issue
Block a user