fix: keep the git source-image property in sync with failed deploys

The source-image property was written before the deploy lock was taken
and was not restored when a deploy failed, so after a rejected
git:from-image or git:load-image it named an image that was not
deployed, and later builds extracted app.json, Procfile, and CHECKS
from it. Deploys from other sources also built while the old image was
still set.

Entry points now pass the desired value via DOKKU_GIT_SOURCE_IMAGE and
git_receive_app applies it while holding the deploy lock, restoring the
previous value on failure. git:sync clears the property under the lock
when it fetches new code.

Closes #9117
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-10-11 05:08:32 -04:00
1 parent 5eaab7cc1a
commit 7955e8ee06
9 files changed
+383 -24

No files matched your search

+2 -1
View File
@@ -60,7 +60,8 @@ trigger-git-git-from-directory() {
fi
rm -rf "$TMP_WORK_DIR" "$TMP_WORK_DIR_2" >/dev/null
if git_receive_app "$APP" "$REV"; then
# run in a subshell so a failure to acquire the deploy lock still reaches the rollback
if (git_receive_app "$APP" "$REV"); then
return
else
local exit_code=$?