refactor to explicitly set IMAGE via get_app_image_name()

This commit is contained in:
Michael Hobbs committed 2015-09-03 16:12:36 -07:00
1 parent 2f16b06a76
commit 495b1d2ba0
14 files changed
+122 -107

No files matched your search

+18 -14
View File
@@ -1,32 +1,36 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$(dirname $0)/../common/functions"
source "$(dirname $0)/functions"
tag_image() {
docker tag -f "$1" "$2"
}
case "$1" in
tag:add)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
APP="$2"; TAG="$3"
APP="$2"; IMAGE_TAG="$3"
verify_app_name "$APP"
verify_image "$IMAGE" || dokku_log_fail "App image ($IMAGE) not found"
tag_image "$IMAGE:latest" "$IMAGE:$TAG"
dokku_log_info2_quiet "Added $TAG tag to $IMAGE"
pluginhook tag-add $APP $TAG
tag_image "$IMAGE:latest" "$IMAGE:$IMAGE_TAG"
dokku_log_info2_quiet "Added $IMAGE_TAG tag to $IMAGE"
pluginhook tag-add $APP $IMAGE_TAG
;;
tag:deploy)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
APP="$2"; TAG="$3"
APP="$2"; IMAGE_TAG="$3"
verify_app_name "$APP"
verify_image "$IMAGE:$TAG" || dokku_log_fail "App image ($IMAGE:$TAG) not found"
verify_image "$IMAGE:$IMAGE_TAG" || dokku_log_fail "App image ($IMAGE:$IMAGE_TAG) not found"
release_and_deploy $APP $TAG
release_and_deploy $APP $IMAGE_TAG
;;
tag:list)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
APP="$2"; verify_app_name "$APP"
APP="$2"
verify_app_name "$APP"
dokku_log_info2_quiet "Image tags for $IMAGE"
docker images "$IMAGE"
@@ -34,19 +38,19 @@ case "$1" in
tag:rm)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
APP="$2"; TAG="$3"
APP="$2"; IMAGE_TAG="$3"
verify_app_name "$2"
case "$TAG" in
case "$IMAGE_TAG" in
latest)
dokku_log_fail "You can't remove internal dokku tag ($TAG) for $IMAGE"
dokku_log_fail "You can't remove internal dokku tag ($IMAGE_TAG) for $IMAGE"
;;
*)
docker rmi "$IMAGE:$TAG"
docker rmi "$IMAGE:$IMAGE_TAG"
;;
esac
pluginhook tag-remove $APP $TAG
pluginhook tag-remove $APP $IMAGE_TAG
;;
help | tag:help)
-7
View File
@@ -1,7 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$(dirname $0)/../common/functions"
tag_image() {
docker tag -f "$1" "$2"
}