feat: add environment variable support for deploy command flags
Allows setting --nats-url, --nkey-file, --branch, --action, and --timeout via HOMELAB_DEPLOY_* environment variables. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ import (
|
||||
"github.com/urfave/cli/v3"
|
||||
)
|
||||
|
||||
const version = "0.1.1"
|
||||
const version = "0.1.2"
|
||||
|
||||
func main() {
|
||||
app := &cli.Command{
|
||||
@@ -189,27 +189,32 @@ func deployCommand() *cli.Command {
|
||||
&cli.StringFlag{
|
||||
Name: "nats-url",
|
||||
Usage: "NATS server URL",
|
||||
Sources: cli.EnvVars("HOMELAB_DEPLOY_NATS_URL"),
|
||||
Required: true,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "nkey-file",
|
||||
Usage: "Path to NKey seed file for NATS authentication",
|
||||
Sources: cli.EnvVars("HOMELAB_DEPLOY_NKEY_FILE"),
|
||||
Required: true,
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "branch",
|
||||
Usage: "Git branch or commit to deploy",
|
||||
Value: "master",
|
||||
Name: "branch",
|
||||
Usage: "Git branch or commit to deploy",
|
||||
Sources: cli.EnvVars("HOMELAB_DEPLOY_BRANCH"),
|
||||
Value: "master",
|
||||
},
|
||||
&cli.StringFlag{
|
||||
Name: "action",
|
||||
Usage: "nixos-rebuild action (switch, boot, test, dry-activate)",
|
||||
Value: "switch",
|
||||
Name: "action",
|
||||
Usage: "nixos-rebuild action (switch, boot, test, dry-activate)",
|
||||
Sources: cli.EnvVars("HOMELAB_DEPLOY_ACTION"),
|
||||
Value: "switch",
|
||||
},
|
||||
&cli.IntFlag{
|
||||
Name: "timeout",
|
||||
Usage: "Timeout in seconds for collecting responses",
|
||||
Value: 900,
|
||||
Name: "timeout",
|
||||
Usage: "Timeout in seconds for collecting responses",
|
||||
Sources: cli.EnvVars("HOMELAB_DEPLOY_TIMEOUT"),
|
||||
Value: 900,
|
||||
},
|
||||
},
|
||||
Action: func(ctx context.Context, c *cli.Command) error {
|
||||
|
||||
Reference in New Issue
Block a user