From 2cfc40dc28459ba22c7d96963132ae097ac5dd21 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Wed, 13 Aug 2025 11:42:52 +0200 Subject: [PATCH] fix: ensure recipe with undeploy See https://git.coopcloud.tech/toolshed/abra/issues/573 --- cli/app/undeploy.go | 4 ++++ tests/integration/app_undeploy.bats | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/cli/app/undeploy.go b/cli/app/undeploy.go index cd25b7b5..12aba61c 100644 --- a/cli/app/undeploy.go +++ b/cli/app/undeploy.go @@ -38,6 +38,10 @@ Passing "--prune/-p" does not remove those volumes.`, app := internal.ValidateApp(args) stackName := app.StackName() + if err := app.Recipe.EnsureExists(); err != nil { + log.Fatal(err) + } + cl, err := client.New(app.Server) if err != nil { log.Fatal(err) diff --git a/tests/integration/app_undeploy.bats b/tests/integration/app_undeploy.bats index f44fd287..c991f8ac 100644 --- a/tests/integration/app_undeploy.bats +++ b/tests/integration/app_undeploy.bats @@ -30,6 +30,20 @@ teardown(){ assert_failure } +# bats test_tags=slow +@test "retrieve recipe if missing" { + _deploy_app + + run rm -rf "$ABRA_DIR/recipes/$TEST_RECIPE" + assert_success + assert_not_exists "$ABRA_DIR/recipes/$TEST_RECIPE" + + run $ABRA app undeploy "$TEST_APP_DOMAIN" --no-input + assert_success + + assert_exists "$ABRA_DIR/recipes/$TEST_RECIPE" +} + # bats test_tags=slow @test "ensure recipe up to date if no --offline" { _deploy_app