subcommand restructure and bashstyle refactor. closes #1579
This commit is contained in:
committed by
Michael Hobbs
parent
76e27f0333
commit
89f289b433
18
plugins/tar/subcommands/build
Executable file
18
plugins/tar/subcommands/build
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
tar_build_cmd() {
|
||||
local desc="calls tar:build-locked via command line"
|
||||
local cmd="tar:build"
|
||||
|
||||
verify_app_name "$2"
|
||||
local APP="$2"; local APP_BUILD_LOCK="$DOKKU_ROOT/$APP/.build.lock"
|
||||
local APP_BUILD_LOCK_MSG="$APP is currently being deployed or locked. Waiting..."
|
||||
[[ $(flock -n "$APP_BUILD_LOCK" true &>/dev/null ; echo $?) -ne 0 ]] && echo "$APP_BUILD_LOCK_MSG"
|
||||
|
||||
shift 1
|
||||
flock -o "$APP_BUILD_LOCK" dokku tar:build-locked "$@"
|
||||
}
|
||||
|
||||
tar_build_cmd "$@"
|
||||
Reference in New Issue
Block a user