forked from toolshed/abra
feat: support no-input mode for deploy ops
This commit is contained in:
parent
6a75ffc051
commit
a491332c1c
@ -149,6 +149,10 @@ recipes.
|
|||||||
|
|
||||||
// DeployOverview shows a deployment overview
|
// DeployOverview shows a deployment overview
|
||||||
func DeployOverview(app config.App, version, message string) error {
|
func DeployOverview(app config.App, version, message string) error {
|
||||||
|
if internal.NoInput {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
tableCol := []string{"server", "compose", "domain", "stack", "version"}
|
tableCol := []string{"server", "compose", "domain", "stack", "version"}
|
||||||
table := abraFormatter.CreateTable(tableCol)
|
table := abraFormatter.CreateTable(tableCol)
|
||||||
|
|
||||||
@ -183,6 +187,10 @@ func DeployOverview(app config.App, version, message string) error {
|
|||||||
|
|
||||||
// NewVersionOverview shows an upgrade or downgrade overview
|
// NewVersionOverview shows an upgrade or downgrade overview
|
||||||
func NewVersionOverview(app config.App, currentVersion, newVersion string) error {
|
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"}
|
tableCol := []string{"server", "compose", "domain", "stack", "current version", "to be deployed"}
|
||||||
table := abraFormatter.CreateTable(tableCol)
|
table := abraFormatter.CreateTable(tableCol)
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import (
|
|||||||
"coopcloud.tech/abra/cli/app"
|
"coopcloud.tech/abra/cli/app"
|
||||||
"coopcloud.tech/abra/cli/catalogue"
|
"coopcloud.tech/abra/cli/catalogue"
|
||||||
"coopcloud.tech/abra/cli/domain"
|
"coopcloud.tech/abra/cli/domain"
|
||||||
|
"coopcloud.tech/abra/cli/internal"
|
||||||
"coopcloud.tech/abra/cli/recipe"
|
"coopcloud.tech/abra/cli/recipe"
|
||||||
"coopcloud.tech/abra/cli/server"
|
"coopcloud.tech/abra/cli/server"
|
||||||
"coopcloud.tech/abra/pkg/config"
|
"coopcloud.tech/abra/pkg/config"
|
||||||
@ -65,6 +66,7 @@ func newAbraApp(version, commit string) *cli.App {
|
|||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
VerboseFlag,
|
VerboseFlag,
|
||||||
DebugFlag,
|
DebugFlag,
|
||||||
|
internal.NoInputFlag,
|
||||||
},
|
},
|
||||||
Authors: []*cli.Author{
|
Authors: []*cli.Author{
|
||||||
{
|
{
|
||||||
|
@ -74,3 +74,13 @@ var DNSProviderFlag = &cli.StringFlag{
|
|||||||
Destination: &DNSProvider,
|
Destination: &DNSProvider,
|
||||||
Required: true,
|
Required: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var NoInput bool
|
||||||
|
|
||||||
|
var NoInputFlag = &cli.BoolFlag{
|
||||||
|
Name: "no-input",
|
||||||
|
Value: false,
|
||||||
|
Aliases: []string{"n"},
|
||||||
|
Usage: "Toggle non-interactive mode",
|
||||||
|
Destination: &NoInput,
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user