Merge pull request #8266 from dokku/6847-allow-force-pull-image-on-git-from-image
Add a method to force build when re-using an image with git:from-image
This commit is contained in:
@@ -141,7 +141,7 @@ cmd-git-from-image() {
|
||||
local cmd="git:from-image"
|
||||
[[ "$1" == "$cmd" ]] && shift 1
|
||||
declare APP DOCKER_IMAGE USER_NAME USER_EMAIL
|
||||
local BUILD_DIR
|
||||
local BUILD_DIR FORCE=false
|
||||
|
||||
ARGS=()
|
||||
skip=false
|
||||
@@ -151,6 +151,11 @@ cmd-git-from-image() {
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ "$arg" == "--force" ]]; then
|
||||
FORCE=true
|
||||
continue
|
||||
fi
|
||||
|
||||
if [[ "$skip" == "true" ]]; then
|
||||
BUILD_DIR="$arg"
|
||||
skip=false
|
||||
@@ -168,6 +173,10 @@ cmd-git-from-image() {
|
||||
verify_app_name "$APP"
|
||||
[[ -z "$DOCKER_IMAGE" ]] && dokku_log_fail "Please specify a docker image"
|
||||
|
||||
if [[ "$FORCE" == "true" ]]; then
|
||||
export DOKKU_APPS_FORCE_DELETE=1
|
||||
fi
|
||||
|
||||
if ! plugn trigger git-from-image "$APP" "$DOCKER_IMAGE" "$BUILD_DIR" "$USER_NAME" "$USER_EMAIL"; then
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user