diff --git a/pkg/apps/gitops.go b/pkg/apps/gitops.go index 6dad2db29b..ebcafe764c 100644 --- a/pkg/apps/gitops.go +++ b/pkg/apps/gitops.go @@ -167,6 +167,7 @@ func (o *GitOpsOptions) DeleteApp(app string, alias string, autoMerge bool) erro // GetApps retrieves all the apps information for the given appNames from the repository and / or the CRD API func (o *GitOpsOptions) GetApps(appNames map[string]bool, expandFn func([]string) (*v1.AppList, error)) (*v1.AppList, error) { + dir := filepath.Join(o.EnvironmentsDir, o.DevEnv.Name) dir, _, _, _, err := gits.ForkAndPullRepo(o.DevEnv.Spec.Source.URL, o.EnvironmentsDir, o.DevEnv.Spec.Source.Ref, "master", o.GitProvider, o.Gitter, "") if err != nil { return nil, errors.Wrapf(err, "couldn't pull the environment repository from %s", o.DevEnv.Name) diff --git a/pkg/cmd/deletecmd/delete_app.go b/pkg/cmd/deletecmd/delete_app.go index ee04c15baf..c4c2eb26bc 100644 --- a/pkg/cmd/deletecmd/delete_app.go +++ b/pkg/cmd/deletecmd/delete_app.go @@ -46,6 +46,7 @@ type DeleteAppOptions struct { Namespace string Purge bool Alias string + AutoMerge bool } // NewCmdDeleteApp creates a command object for this command @@ -74,6 +75,7 @@ func NewCmdDeleteApp(commonOpts *opts.CommonOptions) *cobra.Command { cmd.Flags().StringVarP(&o.Namespace, opts.OptionNamespace, "n", defaultNamespace, "The Namespace to install into (available when NOT using GitOps for your dev environment)") cmd.Flags().StringVarP(&o.Alias, opts.OptionAlias, "", "", "An alias to use for the app (available when using GitOps for your dev environment)") + cmd.Flags().BoolVarP(&o.AutoMerge, "auto-merge", "", false, "Automatically merge GitOps pull requests that pass CI") return cmd } @@ -89,6 +91,7 @@ func (o *DeleteAppOptions) Run() error { GitOps: o.GitOps, BatchMode: o.BatchMode, Helmer: o.Helm(), + AutoMerge: o.AutoMerge, } if o.GitOps {