feat: properly export env vars for cnb apps

They are not baked into the image like they are for herokuish, so we need to manually set them via --env. Additionally, due to newline constraints in docker, we need to use `--env=key` format to correctly pull the values into place.
This commit is contained in:
Jose Diaz-Gonzalez
2021-02-11 03:52:02 -05:00
parent 5921692f83
commit 812e34c6f5
5 changed files with 48 additions and 3 deletions

View File

@@ -14,8 +14,8 @@ trigger-config-docker-args() {
STDIN=$(cat)
trigger="$0 config_docker_args"
if ! is_image_herokuish_based "$IMAGE" "$APP"; then
ENV_ARGS="$(config_export app "$APP" --format docker-args --merged)"
if ! is_image_herokuish_based "$IMAGE" "$APP" || is_image_cnb_based "$IMAGE"; then
ENV_ARGS="$(config_export app "$APP" --format docker-args-keys --merged)"
echo -n "$STDIN $ENV_ARGS"
else
echo -n "$STDIN"

View File

@@ -222,6 +222,7 @@ fn-start-app-container() {
declare -a __DOKKU_DOCKER_ARG_ARRAY
eval "__DOKKU_DOCKER_ARG_ARRAY=($DOCKER_ARGS)"
eval "$(config_export app "$APP")"
"$DOCKER_BIN" container create "${__DOKKU_DOCKER_ARG_ARRAY[@]}"
}