From 93cf9cc1189d8d020d259d5dcd0d6957b72cec81 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:30:15 -0500 Subject: [PATCH] refactor: remove support for the nixpacks no-cache property This replicates the docker-options functionality. --- docs/deployment/builders/nixpacks.md | 38 +++------------------ plugins/builder-nixpacks/builder-build | 1 - plugins/builder-nixpacks/internal-functions | 26 -------------- plugins/builder-nixpacks/subcommands/set | 4 +-- 4 files changed, 6 insertions(+), 63 deletions(-) diff --git a/docs/deployment/builders/nixpacks.md b/docs/deployment/builders/nixpacks.md index 46559ca68..945b424c3 100644 --- a/docs/deployment/builders/nixpacks.md +++ b/docs/deployment/builders/nixpacks.md @@ -80,28 +80,10 @@ dokku builder-nixpacks:set --global nixpackstoml-path ### Disabling cache -Cache is enabled by default, but can be disabled by setting the `no-cache` property to `true`: +Disable cache using the [docker-options] plugin: ```shell -dokku builder-nixpacks:set node-js-app no-cache true -``` - -The default value may be set by passing an empty value for the option: - -```shell -dokku builder-nixpacks:set node-js-app no-cache -``` - -The `no-cache` property can also be set globally. The global default is `false`, and the global value is used when no app-specific value is set. - -```shell -dokku builder-nixpacks:set --global no-cache true -``` - -The default value may be set by passing an empty value for the option. - -```shell -dokku builder-nixpacks:set --global no-cache +dokku docker-options:add node-js-app build "--no-cache" ``` ### Displaying builder-nixpacks reports for an app @@ -117,23 +99,14 @@ dokku builder-nixpacks:report Builder-nixpacks computed nixpackstoml path: nixpacks2.toml Builder-nixpacks global nixpackstoml path: nixpacks.toml Builder-nixpacks nixpackstoml path: nixpacks2.toml - Builder-nixpacks computed no cache: true - Builder-nixpacks global no cache: false - Builder-nixpacks no cache: true =====> python-sample builder-nixpacks information Builder-nixpacks computed nixpackstoml path: nixpacks.toml Builder-nixpacks global nixpackstoml path: nixpacks.toml Builder-nixpacks nixpackstoml path: - Builder-nixpacks computed no cache: false - Builder-nixpacks global no cache: false - Builder-nixpacks no cache: =====> ruby-sample builder-nixpacks information Builder-nixpacks computed nixpackstoml path: nixpacks.toml Builder-nixpacks global nixpackstoml path: nixpacks.toml Builder-nixpacks nixpackstoml path: - Builder-nixpacks computed no cache: false - Builder-nixpacks global no cache: false - Builder-nixpacks no cache: ``` You can run the command for a specific app also. @@ -147,17 +120,14 @@ dokku builder-nixpacks:report node-js-app Builder-nixpacks computed nixpackstoml path: nixpacks2.toml Builder-nixpacks global nixpackstoml path: nixpacks.toml Builder-nixpacks nixpackstoml path: nixpacks2.toml - Builder-nixpacks computed no cache: true - Builder-nixpacks global no cache: false - Builder-nixpacks no cache: true ``` You can pass flags which will output only the value of the specific information you want. For example: ```shell -dokku builder-nixpacks:report node-js-app --builder-nixpacks-no-cache +dokku builder-nixpacks:report node-js-app --builder-nixpacks-nixpackstoml-path ``` ``` -true +nixpacks2.toml ``` diff --git a/plugins/builder-nixpacks/builder-build b/plugins/builder-nixpacks/builder-build index d1ab7340e..d7fa62820 100755 --- a/plugins/builder-nixpacks/builder-build +++ b/plugins/builder-nixpacks/builder-build @@ -36,7 +36,6 @@ trigger-builder-nixpacks-builder-build() { local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=" $DOKKU_GLOBAL_BUILD_ARGS" - [[ "$(fn-builder-nixpacks-computed-no-cache "$APP")" == "true" ]] && DOCKER_ARGS+=" --no-cache" DOCKER_ARGS=" $DOCKER_ARGS " eval set -- "$DOCKER_ARGS" diff --git a/plugins/builder-nixpacks/internal-functions b/plugins/builder-nixpacks/internal-functions index 582fc33fa..d2c60a133 100755 --- a/plugins/builder-nixpacks/internal-functions +++ b/plugins/builder-nixpacks/internal-functions @@ -38,9 +38,6 @@ cmd-builder-nixpacks-report-single() { "--builder-nixpacks-computed-nixpackstoml-path: $(fn-builder-nixpacks-computed-nixpackstoml-path "$APP")" "--builder-nixpacks-global-nixpackstoml-path: $(fn-builder-nixpacks-global-nixpackstoml-path "$APP")" "--builder-nixpacks-nixpackstoml-path: $(fn-builder-nixpacks-nixpackstoml-path "$APP")" - "--builder-nixpacks-computed-no-cache: $(fn-builder-nixpacks-computed-no-cache "$APP")" - "--builder-nixpacks-global-no-cache: $(fn-builder-nixpacks-global-no-cache "$APP")" - "--builder-nixpacks-no-cache: $(fn-builder-nixpacks-no-cache "$APP")" ) if [[ -z "$INFO_FLAG" ]]; then @@ -91,26 +88,3 @@ fn-builder-nixpacks-nixpackstoml-path() { fn-plugin-property-get "builder-nixpacks" "$APP" "nixpackstoml-path" "" } - -fn-builder-nixpacks-computed-no-cache() { - declare APP="$1" - - file="$(fn-builder-nixpacks-no-cache "$APP")" - if [[ "$file" == "" ]]; then - file="$(fn-builder-nixpacks-global-no-cache "$APP")" - fi - - echo "$file" -} - -fn-builder-nixpacks-global-no-cache() { - declare APP="$1" - - fn-plugin-property-get "builder-nixpacks" "--global" "no-cache" "false" -} - -fn-builder-nixpacks-no-cache() { - declare APP="$1" - - fn-plugin-property-get "builder-nixpacks" "$APP" "no-cache" "" -} diff --git a/plugins/builder-nixpacks/subcommands/set b/plugins/builder-nixpacks/subcommands/set index 711b60d72..de7d46513 100755 --- a/plugins/builder-nixpacks/subcommands/set +++ b/plugins/builder-nixpacks/subcommands/set @@ -9,13 +9,13 @@ cmd-builder-nixpacks-set() { declare cmd="builder-nixpacks:set" [[ "$1" == "$cmd" ]] && shift 1 declare APP="$1" KEY="$2" VALUE="$3" - local VALID_KEYS=("nixpackstoml-path" "no-cache") + local VALID_KEYS=("nixpackstoml-path") [[ "$APP" == "--global" ]] || verify_app_name "$APP" [[ -z "$KEY" ]] && dokku_log_fail "No key specified" if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then - dokku_log_fail "Invalid key specified, valid keys include: nixpackstoml-path, no-cache" + dokku_log_fail "Invalid key specified, valid keys include: nixpackstoml-path" fi if [[ -n "$VALUE" ]]; then