Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 💡 environmentApply file #637

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/cloud-platform_environment_apply.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ $ cloud-platform environment apply -n <namespace>
--is-apply-pipeline is this running in the apply pipelines
--kubecfg string path to kubeconfig file (default "/home/runner/.kube/config")
-n, --namespace string Namespace which you want to perform the apply
--prNumber int Pull request ID or number to which you want to perform the apply
--pr-number int Pull request ID or number to which you want to perform the apply
--redact Redact the terraform output before printing (default true)
```

Expand Down
2 changes: 1 addition & 1 deletion doc/cloud-platform_environment_destroy.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ $ cloud-platform environment destroy -n <namespace>
-h, --help help for destroy
--kubecfg string path to kubeconfig file (default "/home/runner/.kube/config")
-n, --namespace string Namespace which you want to perform the destroy
--prNumber int Pull request ID or number to which you want to perform the destroy
--pr-number int Pull request ID or number to which you want to perform the destroy
--redact Redact the terraform output before printing (default true)
--skip-prod-destroy skip prod namespaces from destroy namespace (default true)
```
Expand Down
2 changes: 1 addition & 1 deletion doc/cloud-platform_environment_plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ $ cloud-platform environment plan
-h, --help help for plan
--kubecfg string path to kubeconfig file (default "/home/runner/.kube/config")
-n, --namespace string Namespace which you want to perform the plan
--prNumber int Pull request ID or number to which you want to perform the plan
--pr-number int Pull request ID or number to which you want to perform the plan
--redact Redact the terraform output before printing (default true)
```

Expand Down
6 changes: 3 additions & 3 deletions pkg/commands/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func addEnvironmentCmd(topLevel *cobra.Command) {
environmentApplyCmd.Flags().IntVar(&optFlags.BatchApplySize, "batch-apply-size", 0, "Number of namespaces to apply in a batch")
environmentApplyCmd.Flags().BoolVar(&optFlags.EnableApplySkip, "enable-apply-skip", false, "Enable skipping apply for a namespace")
environmentApplyCmd.Flags().StringVarP(&optFlags.Namespace, "namespace", "n", "", "Namespace which you want to perform the apply")
environmentApplyCmd.Flags().IntVar(&optFlags.PRNumber, "prNumber", 0, "Pull request ID or number to which you want to perform the apply")
environmentApplyCmd.Flags().IntVar(&optFlags.PRNumber, "pr-number", 0, "Pull request ID or number to which you want to perform the apply")
// Re-use the environmental variable TF_VAR_github_token to call Github Client which is needed to perform terraform operations on each namespace
environmentApplyCmd.Flags().StringVar(&optFlags.GithubToken, "github-token", os.Getenv("TF_VAR_github_token"), "Personal access Token from Github ")
environmentApplyCmd.Flags().StringVar(&optFlags.KubecfgPath, "kubecfg", filepath.Join(homedir.HomeDir(), ".kube", "config"), "path to kubeconfig file")
Expand All @@ -78,7 +78,7 @@ func addEnvironmentCmd(topLevel *cobra.Command) {
environmentCreateCmd.Flags().StringVarP(&answersFile, "answers-file", "a", "", "Path to the answers file")

// e.g. if this is the Pull request to perform the apply: https://github.com/ministryofjustice/cloud-platform-environments/pull/8370, the pr ID is 8370.
environmentDestroyCmd.Flags().IntVar(&optFlags.PRNumber, "prNumber", 0, "Pull request ID or number to which you want to perform the destroy")
environmentDestroyCmd.Flags().IntVar(&optFlags.PRNumber, "pr-number", 0, "Pull request ID or number to which you want to perform the destroy")
environmentDestroyCmd.Flags().StringVarP(&optFlags.Namespace, "namespace", "n", "", "Namespace which you want to perform the destroy")

// Re-use the environmental variable TF_VAR_github_token to call Github Client which is needed to perform terraform operations on each namespace
Expand All @@ -97,7 +97,7 @@ func addEnvironmentCmd(topLevel *cobra.Command) {
}

// e.g. if this is the Pull request to perform the apply: https://github.com/ministryofjustice/cloud-platform-environments/pull/8370, the pr ID is 8370.
environmentPlanCmd.Flags().IntVar(&optFlags.PRNumber, "prNumber", 0, "Pull request ID or number to which you want to perform the plan")
environmentPlanCmd.Flags().IntVar(&optFlags.PRNumber, "pr-number", 0, "Pull request ID or number to which you want to perform the plan")
environmentPlanCmd.Flags().StringVarP(&optFlags.Namespace, "namespace", "n", "", "Namespace which you want to perform the plan")

// Re-use the environmental variable TF_VAR_github_token to call Github Client which is needed to perform terraform operations on each namespace
Expand Down
Loading