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:
Michael Hobbs
2016-06-16 12:43:11 -07:00
committed by GitHub
4 changed files with 20 additions and 1 deletions

View File

@@ -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"

View File

View File

View 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")