feat: support no-input mode for deploy ops

This commit is contained in:
decentral1se 2021-10-21 20:48:45 +02:00
parent 6a75ffc051
commit a491332c1c
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
3 changed files with 20 additions and 0 deletions

View File

@ -149,6 +149,10 @@ recipes.
// DeployOverview shows a deployment overview
func DeployOverview(app config.App, version, message string) error {
if internal.NoInput {
return nil
}
tableCol := []string{"server", "compose", "domain", "stack", "version"}
table := abraFormatter.CreateTable(tableCol)
@ -183,6 +187,10 @@ func DeployOverview(app config.App, version, message string) error {
// NewVersionOverview shows an upgrade or downgrade overview
func NewVersionOverview(app config.App, currentVersion, newVersion string) error {
if internal.NoInput {
return nil
}
tableCol := []string{"server", "compose", "domain", "stack", "current version", "to be deployed"}
table := abraFormatter.CreateTable(tableCol)

View File

@ -9,6 +9,7 @@ import (
"coopcloud.tech/abra/cli/app"
"coopcloud.tech/abra/cli/catalogue"
"coopcloud.tech/abra/cli/domain"
"coopcloud.tech/abra/cli/internal"
"coopcloud.tech/abra/cli/recipe"
"coopcloud.tech/abra/cli/server"
"coopcloud.tech/abra/pkg/config"
@ -65,6 +66,7 @@ func newAbraApp(version, commit string) *cli.App {
Flags: []cli.Flag{
VerboseFlag,
DebugFlag,
internal.NoInputFlag,
},
Authors: []*cli.Author{
{

View File

@ -74,3 +74,13 @@ var DNSProviderFlag = &cli.StringFlag{
Destination: &DNSProvider,
Required: true,
}
var NoInput bool
var NoInputFlag = &cli.BoolFlag{
Name: "no-input",
Value: false,
Aliases: []string{"n"},
Usage: "Toggle non-interactive mode",
Destination: &NoInput,
}