fix(deploy): only output when actually waiting
continuous-integration/drone/push Build is passing Details

This commit is contained in:
decentral1se 2024-07-08 00:45:03 +02:00
parent 465827d5ee
commit 1a8dca9804
Signed by: decentral1se
GPG Key ID: 03789458B3D0C410
1 changed files with 10 additions and 10 deletions

View File

@ -208,16 +208,23 @@ func deployCompose(ctx context.Context, cl *dockerClient.Client, opts Deploy, co
return err
}
serviceIDs, err := deployServices(ctx, cl, services, namespace, opts.SendRegistryAuth, opts.ResolveImage, appName, dontWait)
serviceIDs, err := deployServices(ctx, cl, services, namespace, opts.SendRegistryAuth, opts.ResolveImage)
if err != nil {
return err
}
if dontWait {
log.Warn("skipping converge logic checks")
return nil
}
log.Infof("waiting for %s to deploy... please hold 🤚", appName)
if err := waitOnServices(ctx, cl, serviceIDs, appName); err == nil {
log.Infof("successfully deployed %s", appName)
}
return err
return nil
}
func getServicesDeclaredNetworks(serviceConfigs []composetypes.ServiceConfig) map[string]struct{} {
@ -332,9 +339,7 @@ func deployServices(
services map[string]swarm.ServiceSpec,
namespace convert.Namespace,
sendAuth bool,
resolveImage string,
appName string,
dontWait bool) ([]string, error) {
resolveImage string) ([]string, error) {
existingServices, err := GetStackServices(ctx, cl, namespace.Name())
if err != nil {
return nil, err
@ -417,11 +422,6 @@ func deployServices(
}
}
if dontWait {
log.Warn("skipping converge logic checks")
return nil, nil
}
return serviceIDs, nil
}