mirror of
https://github.com/dokku/dokku.git
synced 2026-07-10 20:40:43 +02:00
Emitting the restart policy as a `--restart` argument from a `docker-args-process-deploy` trigger exposed a latent gluing bug: proxy and builder triggers concatenated `$STDIN$output` with no separator, and the scheduler and builders appended `docker-args-process-*` output directly onto the older `docker-args-*` output, so adjacent arguments could merge into values like `--restart=on-failure:10--label`. A space is now inserted at both the trigger echo and the concatenation so arguments always stay separated.
30 lines
897 B
Bash
Executable File
30 lines
897 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
trigger-builder-pack-docker-args-process-deploy() {
|
|
declare desc="builder-pack core-post-deploy plugin trigger"
|
|
declare trigger="docker-args-process-deploy"
|
|
declare APP="$1" IMAGE_SOURCE_TYPE="$2" IMAGE_TAG="$3" PROC_TYPE="$4"
|
|
local STDIN=$(cat)
|
|
local inject_launcher output
|
|
|
|
if [[ "$IMAGE_SOURCE_TYPE" != "pack" ]]; then
|
|
return
|
|
fi
|
|
|
|
inject_launcher=true
|
|
if [[ -n "$IMAGE_TAG" ]] && [[ -n "$PROC_TYPE" ]] && [[ -z "$(plugn trigger procfile-get-command "$APP" "$PROC_TYPE" "5000" 2>/dev/null || echo '')" ]]; then
|
|
inject_launcher=false
|
|
fi
|
|
|
|
if [[ "$inject_launcher" == "true" ]]; then
|
|
# without this, the command and arguments are passed as args to the default process type
|
|
output=" --entrypoint launcher"
|
|
fi
|
|
|
|
echo -n "$STDIN $output"
|
|
}
|
|
|
|
trigger-builder-pack-docker-args-process-deploy "$@"
|