Skip to content

Commit

Permalink
add language to create app
Browse files Browse the repository at this point in the history
  • Loading branch information
Davor Gajic committed Jul 10, 2024
1 parent 83a77d5 commit b860a28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions create/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions update/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit b860a28

Please sign in to comment.