From 7a545759f27f98ba0a5be1a642119050242ca0fa Mon Sep 17 00:00:00 2001 From: Michael Hobbs Date: Fri, 12 Jun 2015 18:07:08 -0700 Subject: [PATCH] initial pass at switching to plugn --- Makefile | 19 +++++---- dokku | 28 ++++++------ plugins/00_dokku-standard/commands | 61 ++++++++++++++------------- plugins/00_dokku-standard/plugin.toml | 4 ++ plugins/20_events/plugin.toml | 4 ++ plugins/apps/commands | 6 +-- plugins/apps/plugin.toml | 4 ++ plugins/backup/commands | 8 ++-- plugins/backup/plugin.toml | 4 ++ plugins/build-env/plugin.toml | 4 ++ plugins/certs/commands | 2 +- plugins/certs/plugin.toml | 4 ++ plugins/checks/plugin.toml | 4 ++ plugins/common/plugin.toml | 4 ++ plugins/config/commands | 2 +- plugins/config/plugin.toml | 4 ++ plugins/docker-options/commands | 2 +- plugins/docker-options/plugin.toml | 4 ++ plugins/domains/commands | 10 ++--- plugins/domains/plugin.toml | 4 ++ plugins/enter/plugin.toml | 4 ++ plugins/git/commands | 12 +++--- plugins/git/plugin.toml | 4 ++ plugins/nginx-vhosts/commands | 4 +- plugins/nginx-vhosts/plugin.toml | 4 ++ plugins/ps/commands | 20 ++++----- plugins/ps/plugin.toml | 4 ++ plugins/shell/commands | 2 +- plugins/shell/plugin.toml | 4 ++ plugins/tags/commands | 4 +- plugins/tags/plugin.toml | 4 ++ plugins/tar/commands | 2 +- plugins/tar/plugin.toml | 4 ++ 33 files changed, 163 insertions(+), 91 deletions(-) create mode 100644 plugins/00_dokku-standard/plugin.toml create mode 100644 plugins/20_events/plugin.toml create mode 100644 plugins/apps/plugin.toml create mode 100644 plugins/backup/plugin.toml create mode 100644 plugins/build-env/plugin.toml create mode 100644 plugins/certs/plugin.toml create mode 100644 plugins/checks/plugin.toml create mode 100644 plugins/common/plugin.toml create mode 100644 plugins/config/plugin.toml create mode 100644 plugins/docker-options/plugin.toml create mode 100644 plugins/domains/plugin.toml create mode 100644 plugins/enter/plugin.toml create mode 100644 plugins/git/plugin.toml create mode 100644 plugins/nginx-vhosts/plugin.toml create mode 100644 plugins/ps/plugin.toml create mode 100644 plugins/shell/plugin.toml create mode 100644 plugins/tags/plugin.toml create mode 100644 plugins/tar/plugin.toml diff --git a/Makefile b/Makefile index 643a107e4..60380bf68 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/dokku b/dokku index 42bfcd234..49fade16e 100755 --- a/dokku +++ b/dokku @@ -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< /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< [-t], Show the last logs for an application (-t follows) run , Run a command in the environment of an application diff --git a/plugins/00_dokku-standard/plugin.toml b/plugins/00_dokku-standard/plugin.toml new file mode 100644 index 000000000..a11d89221 --- /dev/null +++ b/plugins/00_dokku-standard/plugin.toml @@ -0,0 +1,4 @@ +[plugin] +description = "dokku core standard plugin" +version = "0.4.0" +[plugin.config] diff --git a/plugins/20_events/plugin.toml b/plugins/20_events/plugin.toml new file mode 100644 index 000000000..0379b2986 --- /dev/null +++ b/plugins/20_events/plugin.toml @@ -0,0 +1,4 @@ +[plugin] +description = "dokku core events logging plugin" +version = "0.4.0" +[plugin.config] diff --git a/plugins/apps/commands b/plugins/apps/commands index 47a1b304f..5d407ac89 100755 --- a/plugins/apps/commands +++ b/plugins/apps/commands @@ -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<, Create a new app apps:destroy , Permanently destroy an app diff --git a/plugins/apps/plugin.toml b/plugins/apps/plugin.toml new file mode 100644 index 000000000..8996403e0 --- /dev/null +++ b/plugins/apps/plugin.toml @@ -0,0 +1,4 @@ +[plugin] +description = "dokku core apps plugin" +version = "0.4.0" +[plugin.config] diff --git a/plugins/backup/commands b/plugins/backup/commands index 1d1cf0655..2fa160979 100755 --- a/plugins/backup/commands +++ b/plugins/backup/commands @@ -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<|--global), Display all global or app-specific config vars config:get (|--global) KEY, Display a global or app-specific config value config:set (|--global) KEY1=VALUE1 [KEY2=VALUE2 ...], Set one or more config vars diff --git a/plugins/config/plugin.toml b/plugins/config/plugin.toml new file mode 100644 index 000000000..21b3aa661 --- /dev/null +++ b/plugins/config/plugin.toml @@ -0,0 +1,4 @@ +[plugin] +description = "dokku core config plugin" +version = "0.4.0" +[plugin.config] diff --git a/plugins/docker-options/commands b/plugins/docker-options/commands index 3834660a9..472b862f4 100755 --- a/plugins/docker-options/commands +++ b/plugins/docker-options/commands @@ -140,7 +140,7 @@ case "$1" in # Display usage help help) - cat && cat<, Display apps docker options for all phases docker-options , Display apps docker options for phase (comma separated phase list) docker-options:add OPTION, Add docker option to app for phase (comma separated phase list) diff --git a/plugins/docker-options/plugin.toml b/plugins/docker-options/plugin.toml new file mode 100644 index 000000000..b986665b1 --- /dev/null +++ b/plugins/docker-options/plugin.toml @@ -0,0 +1,4 @@ +[plugin] +description = "dokku core docker-options plugin" +version = "0.4.0" +[plugin.config] diff --git a/plugins/domains/commands b/plugins/domains/commands index 9f4f78a11..2371acf7e 100755 --- a/plugins/domains/commands +++ b/plugins/domains/commands @@ -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<, List custom domains for app domains:add DOMAIN, Add a custom domain to app domains:clear , Clear all custom domains for app diff --git a/plugins/domains/plugin.toml b/plugins/domains/plugin.toml new file mode 100644 index 000000000..61195367e --- /dev/null +++ b/plugins/domains/plugin.toml @@ -0,0 +1,4 @@ +[plugin] +description = "dokku core domains plugin" +version = "0.4.0" +[plugin.config] diff --git a/plugins/enter/plugin.toml b/plugins/enter/plugin.toml new file mode 100644 index 000000000..3e42aeea1 --- /dev/null +++ b/plugins/enter/plugin.toml @@ -0,0 +1,4 @@ +[plugin] +description = "dokku core enter plugin" +version = "0.4.0" +[plugin.config] diff --git a/plugins/git/commands b/plugins/git/commands index 4848db0f3..44b471d9d 100755 --- a/plugins/git/commands +++ b/plugins/git/commands @@ -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 ${refname/refs\/heads\/}:master'" @@ -51,9 +51,9 @@ case "$1" in git-upload-pack) APP="$(echo $2 | perl -pe 's/(?, (Re)builds nginx config for given app EOF ;; diff --git a/plugins/nginx-vhosts/plugin.toml b/plugins/nginx-vhosts/plugin.toml new file mode 100644 index 000000000..7356a63d8 --- /dev/null +++ b/plugins/nginx-vhosts/plugin.toml @@ -0,0 +1,4 @@ +[plugin] +description = "dokku core nginx-vhosts plugin" +version = "0.4.0" +[plugin.config] diff --git a/plugins/ps/commands b/plugins/ps/commands index a24b10a58..b7c5101ec 100755 --- a/plugins/ps/commands +++ b/plugins/ps/commands @@ -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<, List processes running in app container(s) ps:scale = [=], Set how many instances of a given process to run ps:start , Start app container(s) diff --git a/plugins/ps/plugin.toml b/plugins/ps/plugin.toml new file mode 100644 index 000000000..128e3456e --- /dev/null +++ b/plugins/ps/plugin.toml @@ -0,0 +1,4 @@ +[plugin] +description = "dokku core ps plugin" +version = "0.4.0" +[plugin.config] diff --git a/plugins/shell/commands b/plugins/shell/commands index cdb05637a..686963ced 100755 --- a/plugins/shell/commands +++ b/plugins/shell/commands @@ -47,7 +47,7 @@ case "$1" in ;; help | shell:help) - cat && cat<