apply: Default to the "boot" goal if --reboot is passed

Fixes #113.
This commit is contained in:
Zhaofeng Li 2022-09-01 18:42:37 -06:00
parent e7356e2c5c
commit 3af3751d8e
2 changed files with 13 additions and 1 deletions

View file

@ -12,6 +12,7 @@
- The `--no-substitutes` option under the `apply` subcommand has been renamed to `--no-substitute` ([#59](https://github.com/zhaofengli/colmena/issues/59)). - The `--no-substitutes` option under the `apply` subcommand has been renamed to `--no-substitute` ([#59](https://github.com/zhaofengli/colmena/issues/59)).
- The [`meta.nodeSpecialArgs`](./reference/meta.md#nodespecialargs) option has been added. It allows specifying node-specific `specialArgs` passed to NixOS modules ([#100](https://github.com/zhaofengli/colmena/pull/100)). - The [`meta.nodeSpecialArgs`](./reference/meta.md#nodespecialargs) option has been added. It allows specifying node-specific `specialArgs` passed to NixOS modules ([#100](https://github.com/zhaofengli/colmena/pull/100)).
- The [`repl`](./reference/cli.html#colmena-repl) subcommand has been added. It allows you to start an [interactive REPL](./features/eval.md#interactive-repl) with access to the complete node configurations. - The [`repl`](./reference/cli.html#colmena-repl) subcommand has been added. It allows you to start an [interactive REPL](./features/eval.md#interactive-repl) with access to the complete node configurations.
- The default goal for `colmena apply` is now `boot` if `--reboot` is specified, and `switch` otherwise ([#113](https://github.com/zhaofengli/colmena/issues/113)).
## [Release 0.3.1](https://github.com/zhaofengli/colmena/releases/tag/v0.3.1) (2022/08/18) ## [Release 0.3.1](https://github.com/zhaofengli/colmena/releases/tag/v0.3.1) (2022/08/18)

View file

@ -127,7 +127,18 @@ pub fn subcommand() -> ClapCommand<'static> {
.about("Apply configurations on remote machines") .about("Apply configurations on remote machines")
.arg(Arg::new("goal") .arg(Arg::new("goal")
.help("Deployment goal") .help("Deployment goal")
.long_help("Same as the targets for switch-to-configuration.\n\"push\" means only copying the closures to remote nodes.") .long_help(r#"The goal of the deployment.
Same as the targets for switch-to-configuration, with the following extra pseudo-goals:
- build: Only build the system profiles
- push: Only copy the closures to remote nodes
- keys: Only upload the keys to the remote nodes
`switch` is the default goal unless `--reboot` is passed, in which case `boot` is the default.
"#)
.default_value("switch")
.default_value_if("reboot", None, Some("boot"))
.default_value("switch") .default_value("switch")
.index(1) .index(1)
.possible_values(&["build", "push", "switch", "boot", "test", "dry-activate", "keys"])) .possible_values(&["build", "push", "switch", "boot", "test", "dry-activate", "keys"]))