fix no-input app deployment when no tty is present

This commit is contained in:
2025-11-03 20:47:19 +01:00
committed by decentral1se
parent cc8703310c
commit 1bdc11ba62
5 changed files with 16 additions and 1 deletions

View File

@ -260,6 +260,7 @@ checkout as-is. Recipe commit hashes are also supported as values for
app.Name,
app.Server,
internal.DontWaitConverge,
internal.NoInput,
f,
); err != nil {
log.Fatal(err)

View File

@ -128,6 +128,7 @@ Pass "--all-services/-a" to restart all services.`),
AppName: app.Name,
ServerName: app.Server,
Filters: f,
NoInput: internal.NoInput,
NoLog: true,
Quiet: true,
}

View File

@ -246,6 +246,7 @@ beforehand. See "abra app backup" for more.`),
stackName,
app.Server,
internal.DontWaitConverge,
internal.NoInput,
f,
); err != nil {
log.Fatal(err)

View File

@ -282,6 +282,7 @@ beforehand. See "abra app backup" for more.`),
stackName,
app.Server,
internal.DontWaitConverge,
internal.NoInput,
f,
); err != nil {
log.Fatal(err)

View File

@ -201,6 +201,7 @@ func RunDeploy(
appName string,
serverName string,
dontWait bool,
noInput bool,
filters filters.Args,
) error {
log.Info(i18n.G("initialising deployment"))
@ -226,6 +227,7 @@ func RunDeploy(
appName,
serverName,
dontWait,
noInput,
filters,
)
}
@ -248,6 +250,7 @@ func deployCompose(
appName string,
serverName string,
dontWait bool,
noInput bool,
filters filters.Args,
) error {
namespace := convert.NewNamespace(opts.Namespace)
@ -311,6 +314,7 @@ func deployCompose(
Services: serviceIDs,
AppName: appName,
ServerName: serverName,
NoInput: noInput,
Filters: filters,
}
@ -561,6 +565,7 @@ func timestamp() string {
type WaitOpts struct {
AppName string
Filters filters.Args
NoInput bool
NoLog bool
Quiet bool
ServerName string
@ -570,7 +575,13 @@ type WaitOpts struct {
func WaitOnServices(ctx context.Context, cl *dockerClient.Client, opts WaitOpts) error {
timeout := time.Duration(WaitTimeout) * time.Second
model := ui.DeployInitialModel(ctx, cl, opts.Services, opts.AppName, timeout, opts.Filters)
tui := tea.NewProgram(model)
var tui *tea.Program
if opts.NoInput {
tui = tea.NewProgram(model, tea.WithoutRenderer(), tea.WithInput(nil))
} else {
tui = tea.NewProgram(model)
}
if !opts.Quiet {
log.Info(i18n.G("polling deployment status"))