From e361b493b1cee3ab37d66e303f55bec32bec71c8 Mon Sep 17 00:00:00 2001 From: decentral1se Date: Fri, 26 Mar 2021 00:01:07 +0100 Subject: [PATCH] Recognise undeployed apps when undeploying Closes https://git.autonomic.zone/coop-cloud/abra/issues/123. --- CHANGELOG.md | 1 + abra | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 33ca417..4d277f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - Replace `--force` with a global `--no-prompt` for avoiding interactive questions ([#118](https://git.autonomic.zone/coop-cloud/abra/issues/118)) - Use [docker-stack-wait-deploy](https://github.com/vitalets/docker-stack-wait-deploy) inspired logic to deploy apps ([#116](https://git.autonomic.zone/coop-cloud/abra/issues/116)) - Add a domain polling check when deploying apps ([#113](https://git.autonomic.zone/coop-cloud/abra/issues/113)) +- Recognise when apps are already undeployed with `abra app undeploy` ([#123](https://git.autonomic.zone/coop-cloud/abra/issues/123)) # abra 0.6.0 (2021-03-17) diff --git a/abra b/abra index 4aaa137..939da4c 100755 --- a/abra +++ b/abra @@ -1223,6 +1223,10 @@ sub_app_undeploy (){ prompt_confirm fi + if ! docker stack ls --format "{{ .Name }}" | grep -q "$STACK_NAME"; then + error "$STACK_NAME is already undeployed, nothing to do" + fi + docker stack rm "$STACK_NAME" }