Skip to content

Commit ff53cf0

Browse files
feat: refer version from environment in start command
1 parent 288fbda commit ff53cf0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

cmd/start.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ This command will start thr gRPC server and allow the gRPC clients to get connec
5050
}
5151
}()
5252

53-
version := "latest"
53+
// this will be the version same as release (as the version is not configurable from the ui)
54+
version := os.Getenv("COMPAGE_CORE_VERSION")
55+
if version == "" {
56+
// default version
57+
version = "v1.0.0"
58+
}
5459
err := ociregistry.PullOCIArtifact("common", version)
5560
cobra.CheckErr(err)
5661
err = ociregistry.PullOCIArtifact("go", version)
@@ -70,12 +75,12 @@ This command will start thr gRPC server and allow the gRPC clients to get connec
7075
err = ociregistry.PullOCIArtifact("dotnet", version)
7176
cobra.CheckErr(err)
7277

73-
// check if the git submodules have been pulled (mainly need to check this on developer's machine)
74-
if checkIfGitSubmodulesExist() {
78+
// check if the language templates have been pulled (mainly need to check this on developer's machine)
79+
if checkIfLanguageTemplatesExist() {
7580
err = startGrpcServer()
7681
cobra.CheckErr(err)
7782
} else {
78-
log.Error("starting gRPC server failed as git submodules don't exist")
83+
log.Error("starting gRPC server failed as language templates don't exist")
7984
}
8085
},
8186
}
@@ -94,7 +99,7 @@ func init() {
9499
// startCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
95100
}
96101

97-
func checkIfGitSubmodulesExist() bool {
102+
func checkIfLanguageTemplatesExist() bool {
98103
// currently available templates
99104
templates := []string{"common-templates", "compage-template-go", "compage-template-java", "compage-template-python", "compage-template-javascript", "compage-template-ruby", "compage-template-rust", "compage-template-typescript"}
100105

0 commit comments

Comments
 (0)