Skip to content

Commit 1b387f7

Browse files
committed
fix: getting version in meta api
1 parent 8e79ab7 commit 1b387f7

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

server/constants/env.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package constants
22

3+
var VERSION = "0.0.1"
4+
35
const (
46
// Envstore identifier
57
// StringStore string store identifier
@@ -13,8 +15,6 @@ const (
1315
EnvKeyEnv = "ENV"
1416
// EnvKeyEnvPath key for cli arg variable ENV_PATH
1517
EnvKeyEnvPath = "ENV_PATH"
16-
// EnvKeyVersion key for build arg version
17-
EnvKeyVersion = "VERSION"
1818
// EnvKeyAuthorizerURL key for env variable AUTHORIZER_URL
1919
// TODO: remove support AUTHORIZER_URL env
2020
EnvKeyAuthorizerURL = "AUTHORIZER_URL"

server/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ func main() {
2121
envstore.ARG_ENV_FILE = flag.String("env_file", "", "Env file path")
2222
flag.Parse()
2323

24-
envstore.EnvStoreObj.UpdateEnvVariable(constants.StringStoreIdentifier, constants.EnvKeyVersion, VERSION)
24+
log.Println("=> version:", VERSION)
25+
constants.VERSION = VERSION
2526

2627
// initialize required envs (mainly db & env file path)
2728
err := env.InitRequiredEnv()

server/test/resolvers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func TestResolvers(t *testing.T) {
1515
// constants.DbTypeArangodb: "http://localhost:8529",
1616
// constants.DbTypeMongodb: "mongodb://localhost:27017",
1717
}
18-
envstore.EnvStoreObj.UpdateEnvVariable(constants.StringStoreIdentifier, constants.EnvKeyVersion, "test")
18+
1919
for dbType, dbURL := range databases {
2020
s := testSetup()
2121
envstore.EnvStoreObj.UpdateEnvVariable(constants.StringStoreIdentifier, constants.EnvKeyDatabaseURL, dbURL)

server/utils/meta.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
// GetMeta helps in getting the meta data about the deployment from EnvData
1010
func GetMetaInfo() model.Meta {
1111
return model.Meta{
12-
Version: envstore.EnvStoreObj.GetStringStoreEnvVariable(constants.EnvKeyVersion),
12+
Version: constants.VERSION,
1313
ClientID: envstore.EnvStoreObj.GetStringStoreEnvVariable(constants.EnvKeyClientID),
1414
IsGoogleLoginEnabled: envstore.EnvStoreObj.GetStringStoreEnvVariable(constants.EnvKeyGoogleClientID) != "" && envstore.EnvStoreObj.GetStringStoreEnvVariable(constants.EnvKeyGoogleClientSecret) != "",
1515
IsGithubLoginEnabled: envstore.EnvStoreObj.GetStringStoreEnvVariable(constants.EnvKeyGithubClientID) != "" && envstore.EnvStoreObj.GetStringStoreEnvVariable(constants.EnvKeyGithubClientSecret) != "",

0 commit comments

Comments
 (0)