initial pass at switching to plugn

This commit is contained in:
Michael Hobbs
2015-06-12 18:07:08 -07:00
committed by Jose Diaz-Gonzalez
parent ac75c726ad
commit 7a545759f2
33 changed files with 163 additions and 91 deletions

View File

@@ -1,7 +1,7 @@
DOKKU_VERSION = master
SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand
PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb
PLUGN_URL ?= https://github.com/progrium/plugn/releases/download/v0.1.0/plugn_0.1.0_linux_x86_64.tgz
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
DOKKU_LIB_ROOT ?= /var/lib/dokku
@@ -23,7 +23,7 @@ else
BUILD_STACK_TARGETS = build-in-docker
endif
.PHONY: all apt-update install version copyfiles man-db plugins dependencies sshcommand pluginhook docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku
.PHONY: all apt-update install version copyfiles man-db plugins dependencies sshcommand plugn docker aufs stack count dokku-installer vagrant-acl-add vagrant-dokku
include tests.mk
include deb.mk
@@ -50,10 +50,11 @@ copyfiles:
mkdir -p ${CORE_PLUGINS_PATH} ${PLUGINS_PATH} ${DISABLED_PLUGINS_PATH}
rm -rf ${CORE_PLUGINS_PATH}/*
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \
rm -Rf ${PLUGINS_PATH}/available/$$plugin && \
rm -Rf ${CORE_PLUGINS_PATH}/$$plugin && \
rm -rf ${PLUGINS_PATH}/$$plugin && \
cp -R plugins/$$plugin ${CORE_PLUGINS_PATH} && \
ln -s ${CORE_PLUGINS_PATH}/$$plugin ${PLUGINS_PATH}; \
ln -s ${CORE_PLUGINS_PATH}/$$plugin ${PLUGINS_PATH}/available; \
done
chown dokku:dokku -R ${PLUGINS_PATH} ${CORE_PLUGINS_PATH} ${DISABLED_PLUGINS_PATH}
$(MAKE) addman
@@ -66,13 +67,13 @@ addman:
version:
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION
plugin-dependencies: pluginhook
plugin-dependencies: plugn
dokku plugins-install-dependencies --core
plugins: pluginhook docker
plugins: plugn docker
dokku plugins-install --core
dependencies: apt-update sshcommand pluginhook docker help2man man-db
dependencies: apt-update sshcommand plugn docker help2man man-db
$(MAKE) -e stack
apt-update:
@@ -89,9 +90,9 @@ sshcommand:
chmod +x /usr/local/bin/sshcommand
sshcommand create dokku /usr/local/bin/dokku
pluginhook:
wget -qO /tmp/pluginhook_0.1.0_amd64.deb ${PLUGINHOOK_URL}
dpkg -i /tmp/pluginhook_0.1.0_amd64.deb
plugn:
wget -qO /tmp/plugn_latest.tgz ${PLUGN_URL}
tar xzf /tmp/plugn_latest.tgz -C /usr/local/bin
docker: aufs
apt-get install -qq -y curl

28
dokku
View File

@@ -16,7 +16,7 @@ export DOKKU_VALID_EXIT=0
export DOKKU_LOGS_DIR=${DOKKU_LOGS_DIR:="/var/log/dokku"}
export DOKKU_EVENTS_LOGFILE=${DOKKU_EVENTS_LOGFILE:="$DOKKU_LOGS_DIR/events.log"}
source "$PLUGIN_PATH/common/functions"
source "$PLUGIN_PATH/available/common/functions"
[[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source $f; done
@@ -66,7 +66,7 @@ case "$1" in
[[ -z $2 ]] && dokku_log_fail "Please specify an app to deploy"
APP="$2"; IMAGE_TAG="$3"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP"
pluginhook pre-deploy $APP $IMAGE_TAG
plugn trigger pre-deploy $APP $IMAGE_TAG
is_image_herokuish_based "$IMAGE" && DOKKU_HEROKUISH=true
DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE"
@@ -85,11 +85,11 @@ case "$1" in
DOKKU_PORT_FILE="$DOKKU_ROOT/$APP/PORT.$PROC_TYPE.$CONTAINER_INDEX"
# start the app
DOCKER_ARGS=$(: | pluginhook docker-args $APP deploy $IMAGE_TAG)
DOCKER_ARGS=$(: | plugn trigger docker-args $APP deploy $IMAGE_TAG)
DOCKER_ARGS+=" -e DYNO='$PROC_TYPE.$CONTAINER_INDEX' "
DOCKER_ARGS+=$(: | pluginhook docker-args-deploy $APP $IMAGE_TAG)
DOCKER_ARGS+=$(: | plugn trigger docker-args-deploy $APP $IMAGE_TAG)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
BIND_EXTERNAL=$(pluginhook bind-external-ip $APP)
BIND_EXTERNAL=$(plugn trigger bind-external-ip $APP)
[[ -n "$DOKKU_HEROKUISH" ]] && START_CMD="/start $PROC_TYPE"
@@ -133,7 +133,7 @@ case "$1" in
else
trap kill_new INT TERM EXIT
dokku_log_info1 "Running pre-flight checks"
pluginhook check-deploy $APP $id $PROC_TYPE $port $ipaddr
plugn trigger check-deploy $APP $id $PROC_TYPE $port $ipaddr
trap - INT TERM EXIT
fi
@@ -161,7 +161,7 @@ case "$1" in
done < "$DOKKU_SCALE_FILE"
dokku_log_info1 "Running post-deploy"
pluginhook post-deploy $APP $port $ipaddr
plugn trigger post-deploy $APP $port $ipaddr
# kill the old container
if [[ -n "$oldids" ]]; then
@@ -202,27 +202,25 @@ case "$1" in
;;
plugins)
for plugin in "$PLUGIN_PATH"/*/; do
basename "$plugin"
done
plugn list
;;
plugins-install)
if [[ $2 == "--core" ]]; then
export PLUGIN_PATH="$PLUGIN_CORE_PATH"
fi
pluginhook install
plugn trigger install
;;
plugins-install-dependencies)
if [[ $2 == "--core" ]]; then
export PLUGIN_PATH="$PLUGIN_CORE_PATH"
fi
pluginhook dependencies
plugn trigger dependencies
;;
plugins-update)
pluginhook update
plugn trigger update
;;
plugins:disable)
@@ -253,7 +251,7 @@ case "$1" in
echo ""
echo "Options:"
cat<<EOF | pluginhook commands help | sort | column -c2 -t -s,
cat<<EOF | plugn trigger commands help | sort | column -c2 -t -s,
help, Print the list of commands
plugins, Print active plugins
plugins-install [--core], Install active plugins (or only core ones)
@@ -266,7 +264,7 @@ EOF
*)
implemented=0
for script in $PLUGIN_PATH/*/commands; do
for script in $PLUGIN_PATH/enabled/*/commands; do
set +e; $script "$@" ; exit_code=$? ; set -e
if [[ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]]; then
continue

View File

@@ -19,39 +19,39 @@ case "$1" in
test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
# *DEPRECATED* in v0.3.15: `pluginhook pre-build` will be removed in future releases
pluginhook pre-build "$APP"
# *DEPRECATED* in v0.3.22: `pluginhook pre-build-buildstep` will be removed in future releases
pluginhook pre-build-buildstep "$APP"
pluginhook pre-build-buildpack "$APP"
# *DEPRECATED* in v0.3.15: `plugn trigger pre-build` will be removed in future releases
plugn trigger pre-build "$APP"
# *DEPRECATED* in v0.3.22: `plugn trigger pre-build-buildstep` will be removed in future releases
plugn trigger pre-build-buildstep "$APP"
plugn trigger pre-build-buildpack "$APP"
# *DEPRECATED* in v0.3.14: `pluginhook docker-args` will be removed in future releases
# *DEPRECATED* in v0.3.14: `plugn trigger docker-args` will be removed in future releases
# https://github.com/progrium/dokku/issues/896 & https://github.com/progrium/dokku/issues/906
DOCKER_ARGS=$(: | pluginhook docker-args $APP build)
DOCKER_ARGS+=$(: | pluginhook docker-args-build $APP)
DOCKER_ARGS=$(: | plugn trigger docker-args $APP build)
DOCKER_ARGS+=$(: | plugn trigger docker-args-build $APP)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
id=$(docker run -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build)
docker attach $id
test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null
# *DEPRECATED* in v0.3.15: `pluginhook post-build` will be removed in future releases
pluginhook post-build "$APP"
# *DEPRECATED* in v0.3.22: `pluginhook post-build-buildstep` will be removed in future releases
pluginhook post-build-buildstep "$APP"
pluginhook post-build-buildpack "$APP"
# *DEPRECATED* in v0.3.15: `plugn trigger post-build` will be removed in future releases
plugn trigger post-build "$APP"
# *DEPRECATED* in v0.3.22: `plugn trigger post-build-buildstep` will be removed in future releases
plugn trigger post-build-buildstep "$APP"
plugn trigger post-build-buildpack "$APP"
;;
dockerfile)
# extract first port from Dockerfile
DOCKERFILE_PORT=$(get_dockerfile_exposed_port Dockerfile)
[[ -n "$DOCKERFILE_PORT" ]] && config_set --no-restart $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT
pluginhook pre-build-dockerfile "$APP"
plugn trigger pre-build-dockerfile "$APP"
[[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
docker build $DOKKU_DOCKER_BUILD_OPTS -t "$IMAGE" .
pluginhook post-build-dockerfile "$APP"
plugn trigger post-build-dockerfile "$APP"
;;
*)
@@ -66,11 +66,11 @@ case "$1" in
case "$IMAGE_SOURCE_TYPE" in
herokuish)
# *DEPRECATED* in v0.3.15: `pluginhook pre-release` will be removed in future releases
pluginhook pre-release $APP $IMAGE_TAG
# *DEPRECATED* in v0.3.22: `pluginhook pre-release-buildstep` will be removed in future releases
pluginhook pre-release-buildstep $APP $IMAGE_TAG
pluginhook pre-release-buildpack $APP $IMAGE_TAG
# *DEPRECATED* in v0.3.15: `plugn trigger pre-release` will be removed in future releases
plugn trigger pre-release "$APP" "$IMAGE_TAG"
# *DEPRECATED* in v0.3.22: `plugn trigger pre-release-buildstep` will be removed in future releases
plugn trigger pre-release-buildstep "$APP" "$IMAGE_TAG"
plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
if [[ -n $(config_export global) ]]; then
id=$(config_export global | docker run -i -a stdin $IMAGE /bin/bash -c "mkdir -p /app/.profile.d && cat > /app/.profile.d/00-global-env.sh")
test "$(docker wait $id)" -eq 0
@@ -81,16 +81,17 @@ case "$1" in
test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null
fi
# *DEPRECATED* in v0.3.15: `pluginhook post-release` will be removed in future releases
pluginhook post-release $APP $IMAGE_TAG
# *DEPRECATED* in v0.3.22: `pluginhook post-release-buildstep` will be removed in future releases
pluginhook post-release-buildstep $APP $IMAGE_TAG
pluginhook post-release-buildpack $APP $IMAGE_TAG
# *DEPRECATED* in v0.3.15: `plugn trigger post-release` will be removed in future releases
plugn trigger post-release "$APP" "$IMAGE_TAG"
# *DEPRECATED* in v0.3.22: `plugn trigger post-release-buildstep` will be removed in future releases
plugn trigger post-release-buildstep "$APP" "$IMAGE_TAG"
plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG"
;;
dockerfile)
pluginhook pre-release-dockerfile $APP $IMAGE_TAG
pluginhook post-release-dockerfile $APP $IMAGE_TAG
# buildstep plugins don't necessarily make sense for dockerfiles. call the new breed!!!
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
;;
*)
@@ -175,8 +176,8 @@ case "$1" in
shift 2
DOCKER_ARGS=$(: | pluginhook docker-args $APP run $IMAGE_TAG)
DOCKER_ARGS+=$(: | pluginhook docker-args-run $APP $IMAGE_TAG)
DOCKER_ARGS=$(: | plugn trigger docker-args $APP run $IMAGE_TAG)
DOCKER_ARGS+=$(: | plugn trigger docker-args-run $APP $IMAGE_TAG)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
[[ $DOKKU_RM_CONTAINER ]] && DOKKU_RUN_OPTS="--rm"
has_tty && DOKKU_RUN_OPTS+=" -i -t"
@@ -222,7 +223,7 @@ case "$1" in
;;
help)
cat && cat<<EOF
cat<<EOF
ls, Pretty listing of deployed applications and containers
logs <app> [-t], Show the last logs for an application (-t follows)
run <app> <cmd>, Run a command in the environment of an application

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core standard plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core events logging plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -38,7 +38,7 @@ case "$1" in
echo "Destroying $APP (including all add-ons)"
pluginhook pre-delete $APP $IMAGE_TAG
plugn trigger pre-delete $APP $IMAGE_TAG
DOKKU_APP_CIDS=$(get_app_container_ids $APP)
if [[ -n $DOKKU_APP_CIDS ]]; then
for ID in $DOKKU_APP_CIDS;do
@@ -47,11 +47,11 @@ case "$1" in
done
fi
pluginhook post-delete $APP $IMAGE_TAG
plugn trigger post-delete $APP $IMAGE_TAG
;;
help | apps:help)
cat && cat<<EOF
cat<<EOF
apps, List your apps
apps:create <app>, Create a new app
apps:destroy <app>, Permanently destroy an app

4
plugins/apps/plugin.toml Normal file
View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core apps plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -11,7 +11,7 @@ case "$1" in
BACKUP_TMP_DIR=$(mktemp -d)
BACKUP_TMP_FILE="$BACKUP_TMP_DIR/backup.tar"
: | pluginhook backup-export 1 $BACKUP_DIR | tar -cf $BACKUP_TMP_FILE --files-from -
: | plugn trigger backup-export 1 $BACKUP_DIR | tar -cf $BACKUP_TMP_FILE --files-from -
pushd $BACKUP_DIR > /dev/null
find . -maxdepth 1 -type d -not -name . | sed 's:./::g' > "$BACKUP_TMP_DIR/.dokku_backup_apps"
@@ -63,7 +63,7 @@ case "$1" in
BACKUP_ROOT="$BACKUP_TMP_DIR""$DOKKU_ROOT"
TARGET_DIR="$DOKKU_ROOT"
if ! pluginhook backup-check $VERSION "$BACKUP_ROOT" "$TARGET_DIR" "$BACKUP_TMP_DIR/.dokku_backup_apps"; then
if ! plugn trigger backup-check $VERSION "$BACKUP_ROOT" "$TARGET_DIR" "$BACKUP_TMP_DIR/.dokku_backup_apps"; then
if $force; then
echo "-f used. Ignoring warnings."
else
@@ -75,7 +75,7 @@ case "$1" in
while read app; do mkdir "$TARGET_DIR/$app"; echo "Imported $app"; done < $BACKUP_TMP_DIR/.dokku_backup_apps
# have the plugins import their stuff
pluginhook backup-import $VERSION "$BACKUP_ROOT" $TARGET_DIR "$BACKUP_TMP_DIR/.dokku_backup_apps"
plugn trigger backup-import $VERSION "$BACKUP_ROOT" $TARGET_DIR "$BACKUP_TMP_DIR/.dokku_backup_apps"
rm -rf $BACKUP_TMP_DIR
@@ -83,7 +83,7 @@ case "$1" in
;;
help | backup:help)
cat && cat<<EOF
cat<<EOF
backup:export [file], Export dokku configuration files
backup:import [file], Import dokku configuration files
EOF

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core backup plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core build-env plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -144,7 +144,7 @@ case "$1" in
if [[ -d "$APP_SSL_PATH" ]]; then
dokku_log_info1 "Removing SSL endpoint from $APP"
rm -rf $APP_SSL_PATH
pluginhook post-domains-update $APP
plugn trigger post-domains-update $APP
else
dokku_log_info1 "An app-specific SSL endpoint is not defined"
fi

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core certificate management plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core checks plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core common plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -33,7 +33,7 @@ case "$1" in
;;
help | config:help)
cat && cat<<EOF
cat<<EOF
config (<app>|--global), Display all global or app-specific config vars
config:get (<app>|--global) KEY, Display a global or app-specific config value
config:set (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...], Set one or more config vars

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core config plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -140,7 +140,7 @@ case "$1" in
# Display usage help
help)
cat && cat<<EOF
cat<<EOF
docker-options <app>, Display apps docker options for all phases
docker-options <app> <phase(s)>, Display apps docker options for phase (comma separated phase list)
docker-options:add <app> <phase(s)> OPTION, Add docker option to app for phase (comma separated phase list)

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core docker-options plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -57,7 +57,7 @@ case "$1" in
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
dokku_log_info1 "Creating new $VHOST_PATH..."
SUBDOMAIN=${APP/%\.${VHOST}/}
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST)
hostname=$(: | plugn trigger nginx-hostname $APP $SUBDOMAIN $VHOST)
if [[ ! -n $hostname ]]; then
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
hostname="${APP/\//-}"
@@ -95,7 +95,7 @@ case "$1" in
done
# we need to restart the app to make sure we're binding to the appropriate network interface
dokku nginx:build-config $APP
pluginhook post-domains-update $APP
plugn trigger post-domains-update $APP
for DOMAIN in "$@";do
dokku_log_info1 "Added $DOMAIN to $APP"
done
@@ -109,7 +109,7 @@ case "$1" in
rm -f "$DOKKU_ROOT/$APP/VHOST"
dokku domains:setup $APP
pluginhook post-domains-update $APP
plugn trigger post-domains-update $APP
dokku_log_info1 "Cleared domains in $APP"
;;
@@ -130,7 +130,7 @@ case "$1" in
for DOMAIN in "$@";do
sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST"
done
pluginhook post-domains-update $APP
plugn trigger post-domains-update $APP
for DOMAIN in "$@";do
dokku_log_info1 "Removed $DOMAIN from $APP"
done
@@ -138,7 +138,7 @@ case "$1" in
;;
help | domains:help)
cat && cat<<EOF
cat<<EOF
domains <app>, List custom domains for app
domains:add <app> DOMAIN, Add a custom domain to app
domains:clear <app>, Clear all custom domains for app

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core domains plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core enter plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -36,11 +36,11 @@ case "$1" in
# Only run this script for the master branch. You can remove this
# if block if you wish to run it for others as well.
if [[ $refname = "refs/heads/master" ]] ; then
# broken out into pluginhook so we might support other methods to receive an app
pluginhook -p receive-app $APP $newrev
# broken out into plugin so we might support other methods to receive an app
plugn trigger receive-app $APP $newrev
else
if test -f "$PLUGIN_PATH"/enabled/*/receive-branch; then
pluginhook receive-branch $APP $newrev $refname
plugn trigger receive-branch $APP $newrev $refname
else
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master."
echo $'\e[1G\e[K'"-----> for example, try 'git push <dokku> ${refname/refs\/heads\/}:master'"
@@ -51,9 +51,9 @@ case "$1" in
git-upload-pack)
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')"
pluginhook git-pre-pull $APP
plugn trigger git-pre-pull $APP
cat | git-upload-pack "$DOKKU_ROOT/$APP"
pluginhook git-post-pull $APP
plugn trigger git-post-pull $APP
;;
git-build)
@@ -100,7 +100,7 @@ EOF
;;
help | git:help)
cat
echo -n ""
;;
*)

4
plugins/git/plugin.toml Normal file
View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core git plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -130,7 +130,7 @@ EOF
if is_deployed "$APP"; then
dokku_log_info1 "Running nginx-pre-reload"
pluginhook nginx-pre-reload $APP $DOKKU_APP_LISTEN_PORT $DOKKU_APP_LISTEN_IP
plugn trigger nginx-pre-reload $APP $DOKKU_APP_LISTEN_PORT $DOKKU_APP_LISTEN_IP
dokku_log_verbose "Reloading nginx"
validate_nginx && restart_nginx
@@ -160,7 +160,7 @@ EOF
fi
;;
help | nginx:help)
cat && cat<<EOF
cat<<EOF
nginx:build-config <app>, (Re)builds nginx config for given app
EOF
;;

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core nginx-vhosts plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -14,7 +14,7 @@ case "$1" in
dokku_log_info1_quiet "running processes in container: $CID"
docker exec $DOKKU_RUN_OPTS $CID /bin/sh -c "ps auxwww"
done
;;
;;
ps:start)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
@@ -28,7 +28,7 @@ case "$1" in
else
echo "App $APP already running"
fi
;;
;;
ps:stop)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
@@ -43,14 +43,14 @@ case "$1" in
else
echo "App $APP already stopped"
fi
;;
;;
ps:rebuild)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
APP="$2"; verify_app_name "$APP"
pluginhook -p receive-app $APP
;;
plugn trigger receive-app $APP
;;
ps:rebuildall)
shopt -s nullglob
@@ -60,7 +60,7 @@ case "$1" in
is_deployed $APP && dokku ps:rebuild $APP
done
shopt -u nullglob
;;
;;
ps:restart)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
@@ -70,7 +70,7 @@ case "$1" in
! (is_deployed $APP) && echo "App $APP has not been deployed" && exit 0
release_and_deploy "$APP" "$IMAGE_TAG"
;;
;;
ps:restartall)
shopt -s nullglob
@@ -80,7 +80,7 @@ case "$1" in
dokku ps:restart $APP
done
shopt -u nullglob
;;
;;
ps:scale)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
@@ -98,10 +98,10 @@ case "$1" in
set_scale "$APP" "$@"
release_and_deploy "$APP" "$IMAGE_TAG"
fi
;;
;;
help | ps:help)
cat && cat<<EOF
cat<<EOF
ps <app>, List processes running in app container(s)
ps:scale <app> <proc>=<count> [<proc>=<count>], Set how many instances of a given process to run
ps:start <app>, Start app container(s)

4
plugins/ps/plugin.toml Normal file
View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core ps plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -47,7 +47,7 @@ case "$1" in
;;
help | shell:help)
cat && cat<<EOF
cat<<EOF
shell, Spawn dokku shell
EOF
;;

View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core shell plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -20,7 +20,7 @@ case "$1" in
tag_image "$IMAGE_REPO:latest" "$IMAGE_REPO:$IMAGE_TAG"
dokku_log_info2_quiet "Added $IMAGE_TAG tag to $IMAGE_REPO"
pluginhook tags-create $APP $IMAGE_TAG
plugn trigger tags-create $APP $IMAGE_TAG
;;
tags:deploy)
@@ -45,7 +45,7 @@ case "$1" in
docker rmi "$IMAGE_REPO:$IMAGE_TAG"
;;
esac
pluginhook tags-destroy $APP $IMAGE_TAG
plugn trigger tags-destroy $APP $IMAGE_TAG
;;
help | tags:help)

4
plugins/tags/plugin.toml Normal file
View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core tags plugin"
version = "0.4.0"
[plugin.config]

View File

@@ -15,7 +15,7 @@ case "$1" in
APP="$2"
verify_app_name "$2"
tee "$DOKKU_ROOT/$APP/src.tar" | wc -c
pluginhook -p receive-app $APP
plugn trigger -p receive-app $APP
;;
tar-build)

4
plugins/tar/plugin.toml Normal file
View File

@@ -0,0 +1,4 @@
[plugin]
description = "dokku core tar plugin"
version = "0.4.0"
[plugin.config]