Skip to content

Commit 8eb4f8e

Browse files
committed
feat: remove default value for revision flag
1 parent d7c98e9 commit 8eb4f8e

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
### Changed
11+
12+
- remove default value for revision flag in the deploy command
13+
1014
### Added
1115

1216
- new command for listing the user companies

docs/30_commands.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ Available flags for the command:
115115
- `--no-semver`, to force the deploy without `semver`
116116
- `--insecure`, to skip certificate check
117117
- `--project-id`, to set the project ID from command line
118-
- `--revision`, to specify the revision of the commit to deploy (default `HEAD`)
118+
- `--revision`, to specify the revision of the commit to deploy

docs/40_examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ The deploy command allow you to trigger a new deploy pipeline for the current pr
5555
argument needed is the environment id that you want to deploy:
5656

5757
```sh
58-
miactl deploy development
58+
miactl deploy development --revision main
5959
```
6060

6161
Additionally if your context don’t contain the project id you can select it via a flag:
6262

6363
```sh
64-
miactl deploy development --project-id <your-project-id>
64+
miactl deploy development --project-id <your-project-id> --revision main
6565
```
6666

6767
You can customize the way your project is deployed:

internal/clioptions/clioptions.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ func (f *CLIOptions) AddCompanyFlags(cmd *cobra.Command) {
6666
}
6767

6868
func (f *CLIOptions) AddDeployFlags(cmd *cobra.Command) {
69-
cmd.PersistentFlags().StringVar(&f.Revision, "revision", "HEAD", "Revision of the commit to deploy")
69+
cmd.PersistentFlags().StringVar(&f.Revision, "revision", "", "Revision of the commit to deploy")
70+
if err := cmd.MarkPersistentFlagRequired("revision"); err != nil {
71+
// if there is an error something very wrong is happening, panic
72+
panic(err)
73+
}
7074
cmd.PersistentFlags().StringVar(&f.DeployType, "deploy-type", "smart_deploy", "Deploy type")
7175
cmd.PersistentFlags().BoolVar(&f.NoSemVer, "no-semver", false, "Force the deploy wihout semver")
7276
}

0 commit comments

Comments
 (0)