feat: add subcommands to allow app locking and unlocking
Unlocking an app will not stop running deploys, so users may need to clean up. However, it is useful for deploys that fail in unusual ways that cause the lock to stay around. Closes #2883
This commit is contained in:
17
plugins/apps/subcommands/lock
Executable file
17
plugins/apps/subcommands/lock
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_AVAILABLE_PATH/apps/internal-functions"
|
||||
|
||||
apps_lock_cmd() {
|
||||
declare desc="creates a '.deploy.lock' file in an application's repo"
|
||||
declare cmd="apps:lock"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP="$1"; verify_app_name "$APP"
|
||||
|
||||
touch "$DOKKU_ROOT/$APP/.deploy.lock" || dokku_log_fail "Unable to create deploy lock"
|
||||
|
||||
dokku_log_info1 "Deploy lock created"
|
||||
}
|
||||
|
||||
apps_lock_cmd "$@"
|
||||
Reference in New Issue
Block a user