feat: add support for checking if an application exists
This is useful for creating review applications in CI/CD pipelines.
This commit is contained in:
@@ -49,3 +49,12 @@ apps_destroy() {
|
||||
|
||||
plugn trigger post-delete "$APP" "$IMAGE_TAG"
|
||||
}
|
||||
|
||||
apps_exists() {
|
||||
declare desc="checks if an app exists"
|
||||
declare APP="$1"
|
||||
is_valid_app_name "$APP"
|
||||
|
||||
[[ -d "$DOKKU_ROOT/$APP" ]] || dokku_log_fail "App does not exist"
|
||||
dokku_log_info1 "App already exists"
|
||||
}
|
||||
|
||||
11
plugins/apps/subcommands/exists
Executable file
11
plugins/apps/subcommands/exists
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_AVAILABLE_PATH/apps/functions"
|
||||
|
||||
apps_exists_cmd() {
|
||||
declare desc="checks if an app exists"
|
||||
local cmd="apps:exists"
|
||||
apps_exists "$2"
|
||||
}
|
||||
|
||||
apps_exists_cmd "$@"
|
||||
Reference in New Issue
Block a user