From 364eac374d80c7a3101aab1cf743c66cf06423ee Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 15 Nov 2025 23:30:24 -0500 Subject: [PATCH] refactor: remove support for the railpack no-cache property This replicates the docker-options functionality. --- docs/deployment/builders/railpack.md | 38 +++------------------ plugins/builder-railpack/builder-build | 1 - plugins/builder-railpack/internal-functions | 26 -------------- plugins/builder-railpack/subcommands/set | 4 +-- 4 files changed, 6 insertions(+), 63 deletions(-) diff --git a/docs/deployment/builders/railpack.md b/docs/deployment/builders/railpack.md index dc0d634fb..cde329846 100644 --- a/docs/deployment/builders/railpack.md +++ b/docs/deployment/builders/railpack.md @@ -89,28 +89,10 @@ dokku builder-railpack:set --global railpackjson-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-railpack:set node-js-app no-cache true -``` - -The default value may be set by passing an empty value for the option: - -```shell -dokku builder-railpack: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-railpack:set --global no-cache true -``` - -The default value may be set by passing an empty value for the option. - -```shell -dokku builder-railpack:set --global no-cache +dokku docker-options:add node-js-app build "--no-cache" ``` ### Displaying builder-railpack reports for an app @@ -126,23 +108,14 @@ dokku builder-railpack:report Builder-railpack computed railpackjson path: railpack2.json Builder-railpack global railpackjson path: railpack.json Builder-railpack railpackjson path: railpack2.json - Builder-railpack computed no cache: true - Builder-railpack global no cache: false - Builder-railpack no cache: true =====> python-sample builder-railpack information Builder-railpack computed railpackjson path: railpack.json Builder-railpack global railpackjson path: railpack.json Builder-railpack railpackjson path: - Builder-railpack computed no cache: false - Builder-railpack global no cache: false - Builder-railpack no cache: =====> ruby-sample builder-railpack information Builder-railpack computed railpackjson path: railpack.json Builder-railpack global railpackjson path: railpack.json Builder-railpack railpackjson path: - Builder-railpack computed no cache: false - Builder-railpack global no cache: false - Builder-railpack no cache: ``` You can run the command for a specific app also. @@ -156,17 +129,14 @@ dokku builder-railpack:report node-js-app Builder-railpack computed railpackjson path: railpack2.json Builder-railpack global railpackjson path: railpack.json Builder-railpack railpackjson path: railpack2.json - Builder-railpack computed no cache: true - Builder-railpack global no cache: false - Builder-railpack no cache: true ``` You can pass flags which will output only the value of the specific information you want. For example: ```shell -dokku builder-railpack:report node-js-app --builder-railpack-no-cache +dokku builder-railpack:report node-js-app --builder-railpack-railpackjson-path ``` ``` -true +railpack2.json ``` diff --git a/plugins/builder-railpack/builder-build b/plugins/builder-railpack/builder-build index 68d2698f3..afc5ff65f 100755 --- a/plugins/builder-railpack/builder-build +++ b/plugins/builder-railpack/builder-build @@ -35,7 +35,6 @@ trigger-builder-railpack-builder-build() { local DOCKER_ARGS=$(: | plugn trigger docker-args-build "$APP" "$BUILDER_TYPE") DOCKER_ARGS+=$(: | plugn trigger docker-args-process-build "$APP" "$BUILDER_TYPE") - [[ "$(fn-builder-railpack-computed-no-cache "$APP")" == "true" ]] && DOCKER_ARGS+=" --no-cache" DOCKER_ARGS=" $DOCKER_ARGS " eval set -- "$DOCKER_ARGS" diff --git a/plugins/builder-railpack/internal-functions b/plugins/builder-railpack/internal-functions index a405b2ed0..96dab71bc 100755 --- a/plugins/builder-railpack/internal-functions +++ b/plugins/builder-railpack/internal-functions @@ -38,9 +38,6 @@ cmd-builder-railpack-report-single() { "--builder-railpack-computed-railpackjson-path: $(fn-builder-railpack-computed-railpackjson-path "$APP")" "--builder-railpack-global-railpackjson-path: $(fn-builder-railpack-global-railpackjson-path "$APP")" "--builder-railpack-railpackjson-path: $(fn-builder-railpack-railpackjson-path "$APP")" - "--builder-railpack-computed-no-cache: $(fn-builder-railpack-computed-no-cache "$APP")" - "--builder-railpack-global-no-cache: $(fn-builder-railpack-global-no-cache "$APP")" - "--builder-railpack-no-cache: $(fn-builder-railpack-no-cache "$APP")" ) if [[ -z "$INFO_FLAG" ]]; then @@ -91,26 +88,3 @@ fn-builder-railpack-railpackjson-path() { fn-plugin-property-get "builder-railpack" "$APP" "railpackjson-path" "" } - -fn-builder-railpack-computed-no-cache() { - declare APP="$1" - - file="$(fn-builder-railpack-no-cache "$APP")" - if [[ "$file" == "" ]]; then - file="$(fn-builder-railpack-global-no-cache "$APP")" - fi - - echo "$file" -} - -fn-builder-railpack-global-no-cache() { - declare APP="$1" - - fn-plugin-property-get "builder-railpack" "--global" "no-cache" "false" -} - -fn-builder-railpack-no-cache() { - declare APP="$1" - - fn-plugin-property-get "builder-railpack" "$APP" "no-cache" "" -} diff --git a/plugins/builder-railpack/subcommands/set b/plugins/builder-railpack/subcommands/set index 6001f0c6f..3ac35030d 100755 --- a/plugins/builder-railpack/subcommands/set +++ b/plugins/builder-railpack/subcommands/set @@ -9,13 +9,13 @@ cmd-builder-railpack-set() { declare cmd="builder-railpack:set" [[ "$1" == "$cmd" ]] && shift 1 declare APP="$1" KEY="$2" VALUE="$3" - local VALID_KEYS=("railpackjson-path" "no-cache") + local VALID_KEYS=("railpackjson-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: railpackjson-path, no-cache" + dokku_log_fail "Invalid key specified, valid keys include: railpackjson-path" fi if [[ -n "$VALUE" ]]; then