fix: reference SOURCECODE_WORK_DIR in builder core-post-extract

The builder-dockerfile, builder-lambda, builder-nixpacks, builder-pack and builder-railpack `core-post-extract` triggers assigned `$2` to a local `SOURCECODE_WORK_DIR` but called `pushd "$TMP_WORK_DIR"`, which was unset. Bash 5.2 silently accepted `pushd ""`, so the bug stayed dormant. Bash 5.3 (shipped with Ubuntu 26.04) makes it a hard error and `set -e` aborts the trigger, causing every `git push` to fail with `pushd: null directory`.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-05-07 12:39:46 -04:00
1 parent 368a6999c9
commit eb17a383c6
10 files changed
+120 -5

No files matched your search

+23
View File
@@ -131,6 +131,29 @@ teardown() {
assert_output "['task.py', 'some', 'cron', 'task']"
}
@test "(builder-nixpacks) core-post-extract renames the configured nixpacks.toml" {
local TMP_DIR
TMP_DIR="$(mktemp -d "/tmp/dokku-test-builder-nixpacks.XXXXXX")"
trap "rm -rf '$TMP_DIR'" RETURN
echo "" >"$TMP_DIR/nixpacks.alt.toml"
run /bin/bash -c "dokku builder-nixpacks:set $TEST_APP nixpackstoml-path nixpacks.alt.toml"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "PLUGIN_PATH=$PLUGIN_PATH PLUGIN_AVAILABLE_PATH=$PLUGIN_AVAILABLE_PATH PLUGIN_ENABLED_PATH=$PLUGIN_ENABLED_PATH PLUGIN_CORE_AVAILABLE_PATH=$PLUGIN_CORE_AVAILABLE_PATH DOKKU_LIB_ROOT=$DOKKU_LIB_ROOT $PLUGIN_ENABLED_PATH/builder-nixpacks/core-post-extract $TEST_APP $TMP_DIR HEAD"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "test -f $TMP_DIR/nixpacks.toml"
assert_success
run /bin/bash -c "test ! -e $TMP_DIR/nixpacks.alt.toml"
assert_success
}
cron_run_wrapper() {
local APP="$1"
local APP_REPO_DIR="$2"