Compare commits
3 Commits
e5836a8b97
...
87344dd601
Author | SHA1 | Date | |
---|---|---|---|
87344dd601 | |||
39e6611602 | |||
355d246010 |
@ -1,6 +1,9 @@
|
||||
package depenv
|
||||
|
||||
import "os"
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
var manageServers = map[DeploymentEnvironment]string{
|
||||
DeployDevel: "https://manage.askdev.grundclock.com",
|
||||
@ -65,3 +68,16 @@ func (d DeploymentEnvironment) APIHost() string {
|
||||
func (d DeploymentEnvironment) ManageURL(path string) string {
|
||||
return manageServers[d] + path
|
||||
}
|
||||
|
||||
func (d *DeploymentEnvironment) UnmarshalText(text []byte) error {
|
||||
s := string(text)
|
||||
if s == "" {
|
||||
return nil
|
||||
}
|
||||
env := DeploymentEnvironmentFromString(s)
|
||||
if env == DeployUndefined {
|
||||
return fmt.Errorf("invalid deployment environment: %s", s)
|
||||
}
|
||||
*d = env
|
||||
return nil
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
go install github.com/goreleaser/goreleaser/v2@v2.5.1
|
||||
go install github.com/goreleaser/goreleaser/v2@v2.8.2
|
||||
|
||||
if [ ! -z "${harbor_username:-}" ]; then
|
||||
DOCKER_FILE=~/.docker/config.json
|
||||
|
@ -13,10 +13,12 @@ import (
|
||||
)
|
||||
|
||||
// VERSION has the current software version (set in the build process)
|
||||
var VERSION string
|
||||
var buildTime string
|
||||
var gitVersion string
|
||||
var gitModified bool
|
||||
var (
|
||||
VERSION string
|
||||
buildTime string
|
||||
gitVersion string
|
||||
gitModified bool
|
||||
)
|
||||
|
||||
var info Info
|
||||
|
||||
@ -28,7 +30,6 @@ type Info struct {
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
info.BuildTime = buildTime
|
||||
info.GitRev = gitVersion
|
||||
|
||||
@ -90,6 +91,15 @@ func VersionCmd(name string) *cobra.Command {
|
||||
return versionCmd
|
||||
}
|
||||
|
||||
type KongVersionCmd struct {
|
||||
Name string `kong:"-"`
|
||||
}
|
||||
|
||||
func (cmd *KongVersionCmd) Run() error {
|
||||
fmt.Printf("%s %s\n", cmd.Name, Version())
|
||||
return nil
|
||||
}
|
||||
|
||||
func RegisterMetric(name string, registry prometheus.Registerer) {
|
||||
if len(name) > 0 {
|
||||
name = strings.ReplaceAll(name, "-", "_")
|
||||
|
Loading…
x
Reference in New Issue
Block a user