0
0
forked from toolshed/abra

Compare commits

..

2 Commits

Author SHA1 Message Date
a4d53a1fe5 change to debug log 2025-08-11 11:40:09 +02:00
508a7491b3 fix: Does not error when recipes folder does not exist in app new 2025-04-25 10:10:26 +02:00
3 changed files with 10 additions and 27 deletions

View File

@ -32,12 +32,12 @@ func ValidateRecipe(args []string, cmdName string) recipe.Recipe {
localRecipes, err := recipe.GetRecipesLocal()
if err != nil {
log.Fatal(err)
}
for _, recipeLocal := range localRecipes {
if _, ok := knownRecipes[recipeLocal]; !ok {
knownRecipes[recipeLocal] = true
log.Debugf("can't read local recipes: %s", err)
} else {
for _, recipeLocal := range localRecipes {
if _, ok := knownRecipes[recipeLocal]; !ok {
knownRecipes[recipeLocal] = true
}
}
}

View File

@ -17,7 +17,6 @@ import (
"coopcloud.tech/abra/pkg/log"
"coopcloud.tech/abra/pkg/ui"
"coopcloud.tech/abra/pkg/upstream/convert"
"github.com/docker/cli/cli/command"
"github.com/docker/cli/cli/command/stack/formatter"
composetypes "github.com/docker/cli/cli/compose/types"
"github.com/docker/docker/api/types"
@ -427,8 +426,7 @@ func deployServices(
services map[string]swarm.ServiceSpec,
namespace convert.Namespace,
sendAuth bool,
resolveImage string,
) ([]ui.ServiceMeta, error) {
resolveImage string) ([]ui.ServiceMeta, error) {
var servicesMeta []ui.ServiceMeta
existingServices, err := GetStackServices(ctx, cl, namespace.Name())
@ -448,21 +446,6 @@ func deployServices(
encodedAuth string
)
// When sendAuth is set, use the docker cli to retrieve the auth token
// for the image we are deploying.
// This enables using a private registry by running docker login on the
// machine, that abra is executed.
if sendAuth {
dockerCLI, err := command.NewDockerCli()
if err != nil {
log.Errorf("retrieving docker auth token: failed create docker cli: %s", err)
}
encodedAuth, err = command.RetrieveAuthTokenFromImage(dockerCLI.ConfigFile(), image)
if err != nil {
log.Errorf("failed to retrieve registry auth for image %s: %s", image, err)
}
}
if service, exists := existingServiceMap[name]; exists {
log.Debugf("updating %s", name)
@ -604,7 +587,7 @@ func WaitOnServices(ctx context.Context, cl *dockerClient.Client, opts WaitOpts)
fmt.Sprintf("%s_%s", opts.AppName, timestamp()),
)
if err := os.MkdirAll(filepath.Join(config.LOGS_DIR, opts.ServerName), 0o764); err != nil {
if err := os.MkdirAll(filepath.Join(config.LOGS_DIR, opts.ServerName), 0764); err != nil {
return fmt.Errorf("waitOnServices: error creating log dir: %s", err)
}

View File

@ -3,5 +3,5 @@ STACK := abra_installer_script
default: deploy
deploy:
@DOCKER_CONTEXT=swarm-0.coopcloud.tech docker stack rm $(STACK) && \
DOCKER_CONTEXT=swarm-0.coopcloud.tech docker stack deploy -c compose.yml $(STACK)
@DOCKER_CONTEXT=swarm.autonomic.zone docker stack rm $(STACK) && \
DOCKER_CONTEXT=swarm.autonomic.zone docker stack deploy -c compose.yml $(STACK)