rename tag to tags. make verbs more consistent

This commit is contained in:
Michael Hobbs
2015-09-03 18:26:02 -07:00
parent ccb9e4a571
commit 5f7c4426b7
5 changed files with 47 additions and 47 deletions

View File

@@ -4,17 +4,26 @@ source "$PLUGIN_PATH/common/functions"
source "$(dirname $0)/functions"
case "$1" in
tag:add)
tags)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
APP="$2"; IMAGE_REPO=$(get_app_image_repo $APP)
verify_app_name "$APP"
dokku_log_info2_quiet "Image tags for $IMAGE_REPO"
docker images "$IMAGE_REPO"
;;
tags:create)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
APP="$2"; IMAGE_TAG="$3"; IMAGE_REPO=$(get_app_image_repo $APP)
verify_app_name "$APP"
tag_image "$IMAGE_REPO:latest" "$IMAGE_REPO:$IMAGE_TAG"
dokku_log_info2_quiet "Added $IMAGE_TAG tag to $IMAGE_REPO"
pluginhook tag-add $APP $IMAGE_TAG
pluginhook tags-create $APP $IMAGE_TAG
;;
tag:deploy)
tags:deploy)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
APP="$2"; IMAGE_TAG="$3"
verify_app_name "$APP"
@@ -22,38 +31,29 @@ case "$1" in
release_and_deploy $APP $IMAGE_TAG
;;
tag:list)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
APP="$2"; IMAGE_REPO=$(get_app_image_repo $APP)
verify_app_name "$APP"
dokku_log_info2_quiet "Image tags for IMAGE_REPO"
docker images "IMAGE_REPO"
;;
tag:rm)
tags:destroy)
[[ -z $2 ]] && echo "Please specify an app to run the command on" && exit 1
APP="$2"; IMAGE_TAG="$3"; IMAGE_REPO=$(get_app_image_repo $APP)
verify_app_name "$2"
case "$IMAGE_TAG" in
latest)
dokku_log_fail "You can't remove internal dokku tag ($IMAGE_TAG) for $IMAGE_REPO"
;;
latest)
dokku_log_fail "You can't remove internal dokku tag ($IMAGE_TAG) for $IMAGE_REPO"
;;
*)
docker rmi "$IMAGE_REPO:$IMAGE_TAG"
;;
*)
docker rmi "$IMAGE_REPO:$IMAGE_TAG"
;;
esac
pluginhook tag-remove $APP $IMAGE_TAG
pluginhook tags-destroy $APP $IMAGE_TAG
;;
help | tag:help)
help | tags:help)
cat && cat<<EOF
tag:add <app> <tag>, Add tag to latest running app image
tag:deploy <app> <tag>, Deploy tagged app image
tag:list <app>, List all app image tags
tag:rm <app> <tag>, Remove app image tag
tags <app>, List all app image tags
tags:create <app> <tag>, Add tag to latest running app image
tags:deploy <app> <tag>, Deploy tagged app image
tags:destroy <app> <tag>, Remove app image tag
EOF
;;