1 parent
c9d9750afe
commit
2b0d34d0db
4 files changed
+32
-36
No files matched your search
+16
-1
@@ -141,7 +141,7 @@ git_hook_cmd() {
|
|||||||
if [[ $refname = "refs/heads/${DOKKU_DEPLOY_BRANCH}" ]]; then
|
if [[ $refname = "refs/heads/${DOKKU_DEPLOY_BRANCH}" ]]; then
|
||||||
# broken out into plugin so we might support other methods to receive an app
|
# broken out into plugin so we might support other methods to receive an app
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
plugn trigger receive-app $APP $newrev
|
git_receive_app "$APP" "$newrev"
|
||||||
else
|
else
|
||||||
if [[ $(find "$PLUGIN_PATH"/enabled/*/receive-branch 2>/dev/null | wc -l) != 0 ]]; then
|
if [[ $(find "$PLUGIN_PATH"/enabled/*/receive-branch 2>/dev/null | wc -l) != 0 ]]; then
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
@@ -169,6 +169,21 @@ git_build() {
|
|||||||
git_build_app_repo $APP $REF
|
git_build_app_repo $APP $REF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
git_receive_app() {
|
||||||
|
declare desc="git receive-app plugin trigger"
|
||||||
|
declare APP="$1" REV="$2"
|
||||||
|
|
||||||
|
# Don't trigger git build if there is no git repository.
|
||||||
|
if [[ ! -d "$DOKKU_ROOT/$APP/refs" ]]; then
|
||||||
|
true
|
||||||
|
else
|
||||||
|
acquire_app_deploy_lock "$APP" "exclusive"
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
git_build $APP $REV
|
||||||
|
release_app_deploy_lock "$APP"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
git_upload_pack_cmd() {
|
git_upload_pack_cmd() {
|
||||||
declare desc="executes git-upload-pack"
|
declare desc="executes git-upload-pack"
|
||||||
declare cmd="git-upload-pack"
|
declare cmd="git-upload-pack"
|
||||||
|
|||||||
@@ -1,22 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
||||||
source "$PLUGIN_AVAILABLE_PATH/git/functions"
|
source "$PLUGIN_AVAILABLE_PATH/git/functions"
|
||||||
|
|
||||||
git_receive_app() {
|
|
||||||
declare desc="git receive-app plugin trigger"
|
|
||||||
local trigger="git_receive_app"
|
|
||||||
local APP="$1"; local REV="$2"
|
|
||||||
|
|
||||||
# Don't trigger git build if there is no git repository.
|
|
||||||
if [[ ! -d "$DOKKU_ROOT/$APP/refs" ]]; then
|
|
||||||
true
|
|
||||||
else
|
|
||||||
acquire_app_deploy_lock "$APP" "exclusive"
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
git_build $APP $REV
|
|
||||||
release_app_deploy_lock "$APP"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
git_receive_app "$@"
|
git_receive_app "$@"
|
||||||
+16
-1
@@ -57,7 +57,7 @@ tar_in_cmd() {
|
|||||||
|
|
||||||
verify_app_name "$2"
|
verify_app_name "$2"
|
||||||
tee "$DOKKU_ROOT/$APP/src.tar" | wc -c
|
tee "$DOKKU_ROOT/$APP/src.tar" | wc -c
|
||||||
plugn trigger receive-app "$APP"
|
tar_receive_app "$APP"
|
||||||
}
|
}
|
||||||
|
|
||||||
tar_from_cmd() {
|
tar_from_cmd() {
|
||||||
@@ -69,3 +69,18 @@ tar_from_cmd() {
|
|||||||
shift 3
|
shift 3
|
||||||
curl -# --insecure -L "$URL" | tar_in_cmd "tar:in" "$APP" "$@"
|
curl -# --insecure -L "$URL" | tar_in_cmd "tar:in" "$APP" "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tar_receive_app() {
|
||||||
|
declare desc="tar receive-app plugin trigger"
|
||||||
|
declare APP="$1"
|
||||||
|
|
||||||
|
# Don't trigger tar build if there is no tarball.
|
||||||
|
if [[ ! -f "$DOKKU_ROOT/$APP/src.tar" ]]; then
|
||||||
|
true
|
||||||
|
else
|
||||||
|
acquire_app_deploy_lock "$APP"
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
tar_build "$@"
|
||||||
|
release_app_deploy_lock "$APP"
|
||||||
|
fi
|
||||||
|
}
|
||||||
@@ -1,22 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
||||||
source "$PLUGIN_AVAILABLE_PATH/tar/functions"
|
source "$PLUGIN_AVAILABLE_PATH/tar/functions"
|
||||||
|
|
||||||
tar_receive_app() {
|
|
||||||
declare desc="tar receive-app plugin trigger"
|
|
||||||
local trigger="tar_receive_app"
|
|
||||||
local APP="$1"; local REV="$2"
|
|
||||||
|
|
||||||
# Don't trigger tar build if there is no tarball.
|
|
||||||
if [[ ! -f "$DOKKU_ROOT/$APP/src.tar" ]]; then
|
|
||||||
true
|
|
||||||
else
|
|
||||||
acquire_app_deploy_lock "$APP"
|
|
||||||
# shellcheck disable=SC2086
|
|
||||||
tar_build "$@"
|
|
||||||
release_app_deploy_lock "$APP"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
tar_receive_app "$@"
|
tar_receive_app "$@"
|
||||||
Reference in new issue
Block a user