feat: remove old app configs
All checks were successful
continuous-integration/drone/push Build is passing

See #577
This commit is contained in:
2025-08-17 15:13:36 +02:00
committed by decentral1se
parent fac372dc73
commit f5a843bd90
3 changed files with 83 additions and 2 deletions

View File

@ -124,6 +124,33 @@ teardown(){
assert_output --partial 'removed'
}
# bats test_tags=slow
@test "detect no configs to remove" {
_deploy_app
_undeploy_app
run $ABRA app rm "$TEST_APP_DOMAIN" --no-input
assert_success
assert_output --partial 'no configs to remove'
}
# bats test_tags=slow
@test "remove old app configs" {
_deploy_app
_undeploy_app
sanitisedDomainName="${TEST_APP_DOMAIN//./_}"
run docker config create "${sanitisedDomainName}_test_conf_v99" "$ABRA_DIR/recipes/abra-test-recipe/abra.sh"
assert_success
assert bash -c "docker config ls | grep -q test_conf_v99"
run $ABRA app rm "$TEST_APP_DOMAIN" --no-input
assert_success
refute bash -c "docker config ls | grep -q test_conf_v99"
}
@test "remove .env file" {
assert_exists "$ABRA_DIR/servers/$TEST_SERVER/$TEST_APP_DOMAIN.env"