refactor: remove support for the railpack no-cache property
This replicates the docker-options functionality.
This commit is contained in:
4 files changed
+6
-63
No files matched your search
@@ -89,28 +89,10 @@ dokku builder-railpack:set --global railpackjson-path
|
|||||||
|
|
||||||
### Disabling cache
|
### 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
|
```shell
|
||||||
dokku builder-railpack:set node-js-app no-cache true
|
dokku docker-options:add node-js-app build "--no-cache"
|
||||||
```
|
|
||||||
|
|
||||||
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
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Displaying builder-railpack reports for an app
|
### Displaying builder-railpack reports for an app
|
||||||
@@ -126,23 +108,14 @@ dokku builder-railpack:report
|
|||||||
Builder-railpack computed railpackjson path: railpack2.json
|
Builder-railpack computed railpackjson path: railpack2.json
|
||||||
Builder-railpack global railpackjson path: railpack.json
|
Builder-railpack global railpackjson path: railpack.json
|
||||||
Builder-railpack railpackjson path: railpack2.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
|
=====> python-sample builder-railpack information
|
||||||
Builder-railpack computed railpackjson path: railpack.json
|
Builder-railpack computed railpackjson path: railpack.json
|
||||||
Builder-railpack global railpackjson path: railpack.json
|
Builder-railpack global railpackjson path: railpack.json
|
||||||
Builder-railpack railpackjson path:
|
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
|
=====> ruby-sample builder-railpack information
|
||||||
Builder-railpack computed railpackjson path: railpack.json
|
Builder-railpack computed railpackjson path: railpack.json
|
||||||
Builder-railpack global railpackjson path: railpack.json
|
Builder-railpack global railpackjson path: railpack.json
|
||||||
Builder-railpack railpackjson path:
|
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.
|
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 computed railpackjson path: railpack2.json
|
||||||
Builder-railpack global railpackjson path: railpack.json
|
Builder-railpack global railpackjson path: railpack.json
|
||||||
Builder-railpack railpackjson path: railpack2.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:
|
You can pass flags which will output only the value of the specific information you want. For example:
|
||||||
|
|
||||||
```shell
|
```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
|
||||||
```
|
```
|
||||||
@@ -35,7 +35,6 @@ trigger-builder-railpack-builder-build() {
|
|||||||
|
|
||||||
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")
|
||||||
[[ "$(fn-builder-railpack-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"
|
||||||
|
|||||||
@@ -38,9 +38,6 @@ cmd-builder-railpack-report-single() {
|
|||||||
"--builder-railpack-computed-railpackjson-path: $(fn-builder-railpack-computed-railpackjson-path "$APP")"
|
"--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-global-railpackjson-path: $(fn-builder-railpack-global-railpackjson-path "$APP")"
|
||||||
"--builder-railpack-railpackjson-path: $(fn-builder-railpack-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
|
if [[ -z "$INFO_FLAG" ]]; then
|
||||||
@@ -91,26 +88,3 @@ fn-builder-railpack-railpackjson-path() {
|
|||||||
|
|
||||||
fn-plugin-property-get "builder-railpack" "$APP" "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" ""
|
|
||||||
}
|
|
||||||
@@ -9,13 +9,13 @@ cmd-builder-railpack-set() {
|
|||||||
declare cmd="builder-railpack:set"
|
declare cmd="builder-railpack:set"
|
||||||
[[ "$1" == "$cmd" ]] && shift 1
|
[[ "$1" == "$cmd" ]] && shift 1
|
||||||
declare APP="$1" KEY="$2" VALUE="$3"
|
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"
|
[[ "$APP" == "--global" ]] || verify_app_name "$APP"
|
||||||
|
|
||||||
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
|
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
|
||||||
|
|
||||||
if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then
|
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
|
fi
|
||||||
|
|
||||||
if [[ -n "$VALUE" ]]; then
|
if [[ -n "$VALUE" ]]; then
|
||||||
|
|||||||
Reference in new issue
Block a user