fix: teach app version command to read new versions
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-10-14 11:29:57 +02:00
parent b69aed3bcf
commit d0828c4d8d
3 changed files with 57 additions and 53 deletions

View File

@ -93,6 +93,19 @@ func GetAllDeployedServices(contextName string) StackStatus {
return StackStatus{services, nil}
}
// GetDeployedServicesByName filters services by name
func GetDeployedServicesByName(ctx context.Context, cl *dockerclient.Client, stackName, serviceName string) StackStatus {
filters := filters.NewArgs()
filters.Add("name", fmt.Sprintf("%s_%s", stackName, serviceName))
services, err := cl.ServiceList(ctx, types.ServiceListOptions{Filters: filters})
if err != nil {
return StackStatus{[]swarm.Service{}, err}
}
return StackStatus{services, nil}
}
// IsDeployed chekcks whether an appp is deployed or not.
func IsDeployed(ctx context.Context, cl *dockerclient.Client, stackName string) (bool, string, error) {
version := ""