refactor: filter out procfile first and include --no-cache in DOCKER_ARGS
This commit is contained in:
1 file changed
+5
-10
@@ -27,15 +27,16 @@ trigger-builder-nixpacks-builder-build() {
|
|||||||
|
|
||||||
plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR"
|
plugn trigger pre-build "$BUILDER_TYPE" "$APP" "$SOURCECODE_WORK_DIR"
|
||||||
|
|
||||||
no_cache="$(fn-builder-nixpacks-computed-no-cache "$APP")"
|
if [[ -f "$SOURCECODE_WORK_DIR/Procfile" ]]; then
|
||||||
NIXPACKS_ARGS=""
|
if procfile-util exists --process-type release; then
|
||||||
if [[ "$no_cache" == "true" ]]; then
|
procfile-util delete --process-type release
|
||||||
NIXPACKS_ARGS="$NIXPACKS_ARGS --no-cache"
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
|
local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE")
|
||||||
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE")
|
DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE")
|
||||||
DOCKER_ARGS+=" $DOKKU_GLOBAL_BUILD_ARGS"
|
DOCKER_ARGS+=" $DOKKU_GLOBAL_BUILD_ARGS"
|
||||||
|
[[ "$(fn-builder-nixpacks-computed-no-cache "$APP")" == "true" ]] && DOCKER_ARGS+=" --no-cache"
|
||||||
|
|
||||||
DOCKER_ARGS=" $DOCKER_ARGS "
|
DOCKER_ARGS=" $DOCKER_ARGS "
|
||||||
eval set -- "$DOCKER_ARGS"
|
eval set -- "$DOCKER_ARGS"
|
||||||
@@ -165,12 +166,6 @@ trigger-builder-nixpacks-builder-build() {
|
|||||||
|
|
||||||
eval "$(config_export app "$APP" --merged)"
|
eval "$(config_export app "$APP" --merged)"
|
||||||
|
|
||||||
if [[ -f "$SOURCECODE_WORK_DIR/Procfile" ]]; then
|
|
||||||
if procfile-util exists --process-type release; then
|
|
||||||
procfile-util delete --process-type release
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
if ! nixpacks build "${DOCKER_BUILD_LABEL_ARGS[@]}" "${NIXPACKS_ARGS[@]}" --name "$IMAGE" "$SOURCECODE_WORK_DIR"; then
|
if ! nixpacks build "${DOCKER_BUILD_LABEL_ARGS[@]}" "${NIXPACKS_ARGS[@]}" --name "$IMAGE" "$SOURCECODE_WORK_DIR"; then
|
||||||
dokku_log_warn "Failure building image"
|
dokku_log_warn "Failure building image"
|
||||||
|
|||||||
Reference in new issue
Block a user