fix: keep track of the source image when building an app via git:from-image

This change fixes issues with ps:rebuild not working as expected - essentially ignoring files in the repo - as well as adds tests.

Closes #5518
This commit is contained in:
Jose Diaz-Gonzalez
2022-12-18 17:57:24 -05:00
parent 654939afa7
commit c3c6e2174a
9 changed files with 171 additions and 10 deletions

View File

@@ -41,9 +41,11 @@ trigger-nginx-vhosts-core-post-extract() {
declare trigger="post-extract"
declare APP="$1" SOURCECODE_WORK_DIR="$2"
local CONF_SIGIL_PATH="$(fn-nginx-computed-nginx-conf-sigil-path "$APP")"
local app_source_image
if [[ -n "$DOKKU_BUILDING_FROM_IMAGE" ]]; then
fn-nginx-vhosts-copy-from-image "$APP" "$DOKKU_BUILDING_FROM_IMAGE" "$CONF_SIGIL_PATH"
app_source_image="$(plugn trigger git-get-property "$APP" "source-image")"
if [[ -n "$app_source_image" ]]; then
fn-nginx-vhosts-copy-from-image "$APP" "$app_source_image" "$CONF_SIGIL_PATH"
else
fn-nginx-vhosts-copy-from-directory "$APP" "$SOURCECODE_WORK_DIR" "$CONF_SIGIL_PATH"
fi