mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
Merge pull request #3630 from dokku/3592-notify-on-bad-branch
Fix issue where push warning on bad branch was skipped
This commit is contained in:
@@ -143,12 +143,12 @@ git_hook_cmd() {
|
||||
# shellcheck disable=SC2086
|
||||
git_receive_app "$APP" "$newrev"
|
||||
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) != 1 ]]; then
|
||||
# shellcheck disable=SC2086
|
||||
plugn trigger receive-branch $APP $newrev $refname
|
||||
else
|
||||
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master."
|
||||
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\//}:master'"
|
||||
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to ${DOKKU_DEPLOY_BRANCH}."
|
||||
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\//}:${DOKKU_DEPLOY_BRANCH}'"
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -18,7 +18,7 @@ teardown() {
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
GIT_REMOTE_BRANCH=global-branch deploy_app
|
||||
GIT_REMOTE_BRANCH=global-branch run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
@@ -28,8 +28,14 @@ teardown() {
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output_contains "deploy did not complete"
|
||||
|
||||
run /bin/bash -c "dokku git:set $TEST_APP deploy-branch app-branch"
|
||||
GIT_REMOTE_BRANCH=app-branch deploy_app
|
||||
GIT_REMOTE_BRANCH=app-branch run deploy_app
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
|
||||
Reference in New Issue
Block a user