Add an example plugin trigger for cache busting Dockerfile builds
Closes #2288
This commit is contained in:
committed by
GitHub
parent
0c62804b1d
commit
905b3028b4
@@ -201,10 +201,23 @@ echo 'derp.dkr.ecr.us-east-1.amazonaws.com'
|
|||||||
|
|
||||||
```shell
|
```shell
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
# Sets a docker build-arg called CACHEBUST which can be used
|
||||||
|
# to bust cache at any arbitrary point in a Dockerfile build
|
||||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||||
|
|
||||||
# TODO
|
cache-bust-build-arg() {
|
||||||
|
declare desc="dockerfile cache busting plugin trigger"
|
||||||
|
local STDIN=$(cat)
|
||||||
|
local APP="$1" IMAGE_SOURCE_TYPE="$2"
|
||||||
|
local output=""
|
||||||
|
|
||||||
|
if [[ "$IMAGE_SOURCE_TYPE" == "dockerfile" ]]; then
|
||||||
|
output=" --build-arg CACHEBUST=$(date +%s)"
|
||||||
|
fi
|
||||||
|
echo -n "$STDIN$output"
|
||||||
|
}
|
||||||
|
|
||||||
|
cache-bust-build-arg "$@"
|
||||||
```
|
```
|
||||||
|
|
||||||
### `docker-args-deploy`
|
### `docker-args-deploy`
|
||||||
|
|||||||
Reference in New Issue
Block a user