Skip to content

Commit

Permalink
Merge pull request #12 from equinor/RA-1478
Browse files Browse the repository at this point in the history
Added triggeredBy argument to deploy command
  • Loading branch information
Ole Joar Austbø Moi authored Jun 18, 2020
2 parents cad5491 + 6cc05f7 commit 2a358ea
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 43 deletions.
3 changes: 3 additions & 0 deletions cmd/deployApplication.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var deployApplicationCmd = &cobra.Command{
return err
}
targetEnvironment, _ := cmd.Flags().GetString("environment")
triggeredByUser, _ := cmd.Flags().GetString("user")
follow, _ := cmd.Flags().GetBool("follow")

if appName == nil || *appName == "" || targetEnvironment == "" {
Expand All @@ -50,6 +51,7 @@ var deployApplicationCmd = &cobra.Command{
triggerPipelineParams.SetAppName(*appName)
triggerPipelineParams.SetPipelineParametersDeploy(&models.PipelineParametersDeploy{
ToEnvironment: targetEnvironment,
TriggeredBy: triggeredByUser,
})

newJob, err := apiClient.Application.TriggerPipelineDeploy(triggerPipelineParams, nil)
Expand All @@ -71,6 +73,7 @@ func init() {
createJobCmd.AddCommand(deployApplicationCmd)
deployApplicationCmd.Flags().StringP("application", "a", "", "Name of the application to deploy")
deployApplicationCmd.Flags().StringP("environment", "e", "", "Target environment to deploy in ('prod', 'dev', 'playground')")
deployApplicationCmd.Flags().StringP("user", "u", "", "The user who triggered the deploy")
deployApplicationCmd.Flags().BoolP("follow", "f", false, "Follow deploy")
}
}
11 changes: 6 additions & 5 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@ require (
contrib.go.opencensus.io/exporter/ocagent v0.6.0 // indirect
github.com/equinor/radix-operator v1.5.10
github.com/fatih/color v1.7.0
github.com/go-openapi/errors v0.19.3
github.com/go-openapi/runtime v0.19.9
github.com/go-openapi/strfmt v0.19.4
github.com/go-openapi/swag v0.19.6
github.com/go-openapi/validate v0.19.5
github.com/go-openapi/errors v0.19.6
github.com/go-openapi/runtime v0.19.18
github.com/go-openapi/strfmt v0.19.5
github.com/go-openapi/swag v0.19.9
github.com/go-openapi/validate v0.19.10
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.11 // indirect
github.com/sirupsen/logrus v1.4.2
github.com/spf13/cobra v0.0.5
go.opencensus.io v0.22.2 // indirect
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6 // indirect
golang.org/x/text v0.3.3 // indirect
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
k8s.io/client-go v12.0.0+incompatible
)
Expand Down
Loading

0 comments on commit 2a358ea

Please sign in to comment.