Allow user to modify the repository and tag when deploying an app
Uses two new plugin triggers: - deployed-app-repository - deployed-app-image-tag Useful when the image is a custom tagged image on a remote repository
This commit is contained in:
1 parent
7b8cefbadc
commit
d7566daacc
4 files changed
+20
-1
No files matched your search
@@ -9,7 +9,7 @@ dokku_deploy_cmd() {
|
|||||||
declare desc="deploy phase"
|
declare desc="deploy phase"
|
||||||
local cmd="deploy"
|
local cmd="deploy"
|
||||||
[[ -z $2 ]] && dokku_log_fail "Please specify an app to 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"
|
verify_app_name "$APP"
|
||||||
plugn trigger pre-deploy "$APP" "$IMAGE_TAG"
|
plugn trigger pre-deploy "$APP" "$IMAGE_TAG"
|
||||||
|
|
||||||
|
|||||||
Whitespace-only changes.
Whitespace-only changes.
@@ -167,6 +167,25 @@ get_app_image_repo() {
|
|||||||
echo "$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() {
|
get_app_image_name() {
|
||||||
declare desc="return image identifier for a given app, tag tuple. validate if tag is presented"
|
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")
|
local APP="$1"; local IMAGE_TAG="$2"; local IMAGE_REPO=$(get_app_image_repo "$APP")
|
||||||
|
|||||||
Reference in new issue
Block a user