mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
When running the dokku command in a directory that the dokku user does not have access to - such as /root - popd will fail loudly (starting in Ubuntu 16.04). This change ignores those errors and changes the working dir in the bin to /tmp. Refs #5012
33 lines
885 B
Bash
Executable File
33 lines
885 B
Bash
Executable File
#!/usr/bin/env bash
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
source "$PLUGIN_AVAILABLE_PATH/builder-dockerfile/internal-functions"
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
trigger-builder-dockerfile-core-post-extract() {
|
|
declare desc="builder-dockerfile post-extract plugin trigger"
|
|
declare trigger="post-extract"
|
|
declare APP="$1" SOURCECODE_WORK_DIR="$2"
|
|
local NEW_DOCKERFILE="$(fn-builder-dockerfile-computed-dockerfile-path "$APP")"
|
|
|
|
pushd "$TMP_WORK_DIR" >/dev/null
|
|
|
|
if [[ -z "$NEW_DOCKERFILE" ]]; then
|
|
return
|
|
fi
|
|
|
|
if [[ "$NEW_DOCKERFILE" == "Dockerfile" ]]; then
|
|
return
|
|
fi
|
|
|
|
if [[ ! -f "$NEW_DOCKERFILE" ]]; then
|
|
dokku_log_fail "Invalid dockerfile-path specified: $NEW_DOCKERFILE"
|
|
return
|
|
fi
|
|
|
|
mv "$NEW_DOCKERFILE" Dockerfile
|
|
popd &>/dev/null || pushd "/tmp" >/dev/null
|
|
}
|
|
|
|
trigger-builder-dockerfile-core-post-extract "$@"
|