From e197aa62d1d8728be191cc659ac8f5c0b7d67f44 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 3 Apr 2022 13:11:52 -0400 Subject: [PATCH 1/3] fix: use correct env var for app name when setting initial DOKKU_DEPLOY_BRANCH propery --- plugins/git/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/functions b/plugins/git/functions index 5d4a62549..bfd69c7c9 100755 --- a/plugins/git/functions +++ b/plugins/git/functions @@ -101,7 +101,7 @@ cmd-git-hook() { plugn trigger deploy-source-set "$APP" "git-push" "$newrev" elif [[ -z "$(fn-git-deploy-branch "$APP" "")" ]]; then echo $'\e[1G\e[K'"-----> Set ${refname/refs\/heads\//} to DOKKU_DEPLOY_BRANCH." - fn-plugin-property-write "git" "$app" "deploy-branch" "${refname/refs\/heads\//}" + fn-plugin-property-write "git" "$APP" "deploy-branch" "${refname/refs\/heads\//}" git_receive_app "$APP" "$newrev" plugn trigger deploy-source-set "$APP" "git-push" "$newrev" else From 98e38bd70dc669531b76b9b80b44d26692bb8007 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 3 Apr 2022 13:14:27 -0400 Subject: [PATCH 2/3] chore: update log output for deploy-branch setting The code was referencing an env var that is no longer used in favor of a git plugin setting. --- plugins/git/functions | 2 +- plugins/git/internal-functions | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/git/functions b/plugins/git/functions index bfd69c7c9..5603aeb96 100755 --- a/plugins/git/functions +++ b/plugins/git/functions @@ -81,7 +81,7 @@ cmd-git-hook() { DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")" if ! git check-ref-format --branch "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then - echo $'\e[1G\e[K'"-----> WARNING: Invalid branch name '$DOKKU_DEPLOY_BRANCH' specified via DOKKU_DEPLOY_BRANCH." + echo $'\e[1G\e[K'"-----> WARNING: Invalid branch name '$DOKKU_DEPLOY_BRANCH' specified via deploy-branch setting." echo $'\e[1G\e[K'"-----> For more details, please see the man page for 'git-check-ref-format.'" return fi diff --git a/plugins/git/internal-functions b/plugins/git/internal-functions index 68eeb098e..3fe7e0aca 100755 --- a/plugins/git/internal-functions +++ b/plugins/git/internal-functions @@ -388,7 +388,7 @@ fn-git-fetch() { DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")" if ! fn-git-cmd "$APP_ROOT" check-ref-format --branch "$DOKKU_DEPLOY_BRANCH" >/dev/null 2>&1; then - dokku_log_warn "Invalid branch name '$DOKKU_DEPLOY_BRANCH' specified via DOKKU_DEPLOY_BRANCH." + dokku_log_warn "Invalid branch name '$DOKKU_DEPLOY_BRANCH' specified via deploy-branch setting." dokku_log_warn "For more details, please see the man page for 'git-check-ref-format.'" return fi From 548bb6eae2cac9cab30a33e1495833006c76ef43 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 3 Apr 2022 13:14:52 -0400 Subject: [PATCH 3/3] chore: always use DOKKU_ROOT env var instead of /home/dokku --- plugins/git/internal-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/git/internal-functions b/plugins/git/internal-functions index 3fe7e0aca..845a64370 100755 --- a/plugins/git/internal-functions +++ b/plugins/git/internal-functions @@ -409,7 +409,7 @@ fn-git-last-updated-at() { declare desc="retrieve the deploy branch for a given application" declare APP="$1" local DOKKU_DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")" - local HEAD_FILE="/home/dokku/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH" + local HEAD_FILE="$DOKKU_ROOT/$APP/refs/heads/$DOKKU_DEPLOY_BRANCH" if [[ -f "$HEAD_FILE" ]]; then stat -c %Y "$HEAD_FILE"