Skip to content
Snippets Groups Projects
Verified Commit f2ac3463 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

adapt new versioning procedure

parent ec35830a
No related branches found
No related tags found
No related merge requests found
......@@ -16,3 +16,4 @@ dist/
/docker/db.env
/docker/haproxy/haproxy.cfg
/docker/.env
/results/
#!/bin/bash
MASTER_BRANCH=master
VERSION_FILE=internal/model/version/VERSION
PREREL=$(git rev-list --count HEAD ^$MASTER_BRANCH)
VERSION=$(cat $VERSION_FILE)
FULL_VERSION="${VERSION}-pr${PREREL}"
echo "$FULL_VERSION" > $VERSION_FILE
git add $VERSION_FILE
git commit -m "dummy prerel version"
git tag "v${FULL_VERSION}"
\ No newline at end of file
......@@ -33,7 +33,7 @@ func main() {
authcode.Init()
versionrepo.ConnectToVersion()
jws.LoadKey()
httpclient.Init(config.Get().IssuerURL, fmt.Sprintf("mytoken-server %s", version.VERSION()))
httpclient.Init(config.Get().IssuerURL, fmt.Sprintf("mytoken-server %s", version.VERSION))
geoip.Init()
settings.InitSettings()
cookies.Init()
......
......@@ -28,7 +28,7 @@ var dbConfig struct {
var app = &cli.App{
Name: "mytoken-migratedb",
Usage: "Command line client for easy database migration between mytoken versions",
Version: version.VERSION(),
Version: version.VERSION,
Compiled: time.Time{},
Authors: []*cli.Author{
{
......
......@@ -40,7 +40,7 @@ func getDoneMap(state versionrepo.DBVersionState) (map[string]bool, map[string]b
}
func migrateDB(mytokenNodes []string) error {
v := "v" + version.VERSION()
v := "v" + version.VERSION
dbState, err := versionrepo.GetVersionState(log.StandardLogger(), nil)
if err != nil {
return err
......
......@@ -86,7 +86,7 @@ var sigKeyFile string
var app = &cli.App{
Name: "mytoken-setup",
Usage: "Command line client for easily setting up a mytoken server",
Version: version.VERSION(),
Version: version.VERSION,
Compiled: time.Time{},
Authors: []*cli.Author{
{
......
......@@ -126,7 +126,7 @@ func ConnectToVersion() {
if hasAllVersions, missingVersions := state.dBHasAllVersions(); !hasAllVersions {
log.WithFields(
log.Fields{
"server_version": version.VERSION(),
"server_version": version.VERSION,
"missing_versions_in_db": missingVersions,
},
).Fatal("database schema not updated to this server version")
......
......@@ -62,7 +62,7 @@ func basicConfiguration() *pkg.MytokenConfiguration {
ProvidersSupported: getProvidersFromConfig(),
TokenSigningAlgValue: config.Get().Signing.Alg,
ServiceDocumentation: config.Get().ServiceDocumentation,
Version: version.VERSION(),
Version: version.VERSION,
},
AccessTokenEndpointGrantTypesSupported: []pkgModel.GrantType{pkgModel.GrantTypeMytoken},
MytokenEndpointGrantTypesSupported: []pkgModel.GrantType{
......
0.6.1
\ No newline at end of file
package version
import (
"fmt"
_ "embed"
"strconv"
"strings"
)
//go:embed VERSION
var VERSION string
// Version segments
const (
MAJOR = 0
MINOR = 6
FIX = 1
DEV = "c"
var (
MAJOR int
MINOR int
FIX int
PRE int
)
var version = fmt.Sprintf("%d.%d.%d", MAJOR, MINOR, FIX)
var devVersion = fmt.Sprintf("%s-%s", version, DEV)
// VERSION returns the current mytoken version
func VERSION() string {
if DEV != "" {
return devVersion
func init() {
if VERSION[len(VERSION)-1] == '\n' {
VERSION = VERSION[:len(VERSION)-1]
}
v := strings.Split(VERSION, ".")
MAJOR, _ = strconv.Atoi(v[0])
MINOR, _ = strconv.Atoi(v[1])
ps := strings.Split(v[2], "-")
FIX, _ = strconv.Atoi(ps[0])
if len(ps) > 1 {
pre := ps[1]
if strings.HasPrefix(pre, "pr") {
pre = pre[2:]
}
PRE, _ = strconv.Atoi(pre)
}
return version
}
internal/server/web/static/img/mytoken-grey.png

8.75 KiB | W: | H:

internal/server/web/static/img/mytoken-grey.png

10.4 KiB | W: | H:

internal/server/web/static/img/mytoken-grey.png
internal/server/web/static/img/mytoken-grey.png
internal/server/web/static/img/mytoken-grey.png
internal/server/web/static/img/mytoken-grey.png
  • 2-up
  • Swipe
  • Onion skin
internal/server/web/static/img/mytoken.png

8.78 KiB | W: | H:

internal/server/web/static/img/mytoken.png

10.4 KiB | W: | H:

internal/server/web/static/img/mytoken.png
internal/server/web/static/img/mytoken.png
internal/server/web/static/img/mytoken.png
internal/server/web/static/img/mytoken.png
  • 2-up
  • Swipe
  • Onion skin
mytoken.png

8.78 KiB | W: | H:

mytoken.png

10.4 KiB | W: | H:

mytoken.png
mytoken.png
mytoken.png
mytoken.png
  • 2-up
  • Swipe
  • Onion skin
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment