Merge pull request #2109 from dokku/modify-deployed-image
Allow user to modify the repository and tag when deploying an app
This commit is contained in:
@@ -9,7 +9,7 @@ dokku_deploy_cmd() {
|
||||
declare desc="deploy phase"
|
||||
local cmd="deploy"
|
||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to deploy"
|
||||
local APP="$2"; local IMAGE_TAG="$3"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||
local APP="$2"; local IMAGE_TAG="$3"; local IMAGE=$(get_deploying_app_image_name "$APP" "$IMAGE_TAG")
|
||||
verify_app_name "$APP"
|
||||
plugn trigger pre-deploy "$APP" "$IMAGE_TAG"
|
||||
|
||||
|
||||
0
plugins/20_events/deployed-app-image-tag
Executable file
0
plugins/20_events/deployed-app-image-tag
Executable file
0
plugins/20_events/deployed-app-repository
Executable file
0
plugins/20_events/deployed-app-repository
Executable file
@@ -167,6 +167,25 @@ get_app_image_repo() {
|
||||
echo "$IMAGE_REPO"
|
||||
}
|
||||
|
||||
get_deploying_app_image_name() {
|
||||
declare desc="return deployed image identifier for a given app, tag tuple. validate if tag is presented"
|
||||
local APP="$1"; local IMAGE_TAG="$2";
|
||||
[[ -z "$APP" ]] && dokku_log_fail "(get_app_image_name) APP must not be null"
|
||||
|
||||
local IMAGE_REMOTE_REPOSITORY=$(plugn trigger deployed-app-repository "$APP")
|
||||
local NEW_IMAGE_TAG=$(plugn trigger deployed-app-image-tag "$APP")
|
||||
|
||||
if [[ -n "$NEW_IMAGE_TAG" ]]; then
|
||||
IMAGE_TAG="$NEW_IMAGE_TAG"
|
||||
fi
|
||||
|
||||
local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
||||
if [[ -n "$IMAGE_REMOTE_REPOSITORY" ]]; then
|
||||
IMAGE="${IMAGE_REMOTE_REPOSITORY}${IMAGE}"
|
||||
fi
|
||||
echo "$IMAGE"
|
||||
}
|
||||
|
||||
get_app_image_name() {
|
||||
declare desc="return image identifier for a given app, tag tuple. validate if tag is presented"
|
||||
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE_REPO=$(get_app_image_repo "$APP")
|
||||
|
||||
Reference in New Issue
Block a user