From b860a287d64736ab5ce72ff2284f14d16cd347e7 Mon Sep 17 00:00:00 2001 From: Davor Gajic Date: Wed, 10 Jul 2024 12:56:33 +0200 Subject: [PATCH] add language to create app --- create/application.go | 2 ++ update/application.go | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/create/application.go b/create/application.go index ba4b597..1ec2571 100644 --- a/create/application.go +++ b/create/application.go @@ -45,6 +45,7 @@ type applicationCmd struct { GitInformationServiceURL string `help:"URL of the git information service." default:"https://git-info.deplo.io" env:"GIT_INFORMATION_SERVICE_URL" hidden:""` SkipRepoAccessCheck bool `help:"Skip the git repository access check" default:"false"` Debug bool `help:"Enable debug messages" default:"false"` + Language string `help:"Language specifies which language your app is. If left empty, deploio will detect the language automatically." enum:",ruby,php,python,golang,nodejs,static" default:""` } type gitConfig struct { @@ -282,6 +283,7 @@ func (app *applicationCmd) newApplication(project string) *apps.Application { }, Spec: apps.ApplicationSpec{ ForProvider: apps.ApplicationParameters{ + Language: apps.Language(app.Language), Git: apps.ApplicationGitConfig{ GitTarget: apps.GitTarget{ URL: app.Git.URL, diff --git a/update/application.go b/update/application.go index 807de58..9b47f6b 100644 --- a/update/application.go +++ b/update/application.go @@ -37,6 +37,7 @@ type applicationCmd struct { GitInformationServiceURL string `help:"URL of the git information service." default:"https://git-info.deplo.io" env:"GIT_INFORMATION_SERVICE_URL" hidden:""` SkipRepoAccessCheck bool `help:"Skip the git repository access check" default:"false"` Debug bool `help:"Enable debug messages" default:"false"` + Language *string `help:"Language specifies which language your app is. If left empty, deploio will detect the language automatically." enum:",ruby,php,python,golang,nodejs,static" default:""` } type gitConfig struct { @@ -198,6 +199,9 @@ func (cmd *applicationCmd) applyUpdates(app *apps.Application) { if cmd.DeployJob != nil { cmd.DeployJob.applyUpdates(&app.Spec.ForProvider.Config) } + if cmd.Language != nil { + app.Spec.ForProvider.Language = apps.Language(*cmd.Language) + } var delEnv []string if cmd.DeleteEnv != nil {