Add an example plugin trigger for cache busting Dockerfile builds

Closes #2288
This commit is contained in:
Jose Diaz-Gonzalez
2016-07-05 02:16:37 -04:00
committed by GitHub
parent 0c62804b1d
commit 905b3028b4

View File

@@ -201,10 +201,23 @@ echo 'derp.dkr.ecr.us-east-1.amazonaws.com'
```shell
#!/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
# 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`