diff --git a/docs/development/plugin-creation.md b/docs/development/plugin-creation.md index e0f92aa88..d27abc9a1 100644 --- a/docs/development/plugin-creation.md +++ b/docs/development/plugin-creation.md @@ -3,7 +3,7 @@ If you create your own plugin: 1. Take a look at the plugins shipped with dokku and hack away! -2. Check out the [list of triggers](http://progrium.viewdocs.io/dokku/development/plughooks) your plugin can implement. +2. Check out the [list of triggers](http://progrium.viewdocs.io/dokku/development/pluginhooks) your plugin can implement. 3. Upload your plugin to github with a repository name in form of `dokku-` (e.g. `dokku-mariadb`) 4. Edit [this page](http://progrium.viewdocs.io/dokku/plugins) and add a link to it. 5. Subscribe to the [dokku development blog](http://progrium.com) to be notified about API changes and releases @@ -15,7 +15,7 @@ The below plugin is a dummy `dokku hello` plugin. If your plugin exposes command ```shell #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" case "$1" in hello) diff --git a/docs/development/pluginhooks.md b/docs/development/pluginhooks.md index 3f1dd7e62..71360ae75 100644 --- a/docs/development/pluginhooks.md +++ b/docs/development/pluginhooks.md @@ -252,7 +252,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x # Installs the graphicsmagick package into the container set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) verify_app_name "$APP" @@ -279,7 +279,7 @@ docker commit $ID $IMAGE > /dev/null # Installs a package specified by the `CONTAINER_PACKAGE` env var set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) verify_app_name "$APP" @@ -305,7 +305,7 @@ docker commit $ID $IMAGE > /dev/null #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) verify_app_name "$APP" @@ -323,7 +323,7 @@ verify_app_name "$APP" #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) verify_app_name "$APP" @@ -343,7 +343,7 @@ verify_app_name "$APP" # `DOKKU_DISABLE_DEPLOY` env var is set to `true` for an app set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/config/functions" +source "$PLUGIN_PATH/available/config/functions" CONTAINERID="$1"; APP="$2"; PORT="$3" ; HOSTNAME="${4:-localhost}" @@ -368,7 +368,7 @@ fi # Runs gulp in our container set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) verify_app_name "$APP" @@ -407,7 +407,7 @@ curl "http://httpstat.us/200" # Clears out the gulp asset build cache for applications set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; GULP_CACHE_DIR="$DOKKU_ROOT/$APP/gulp"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) verify_app_name "$APP" @@ -462,7 +462,7 @@ set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) verify_app_name "$APP" @@ -480,7 +480,7 @@ verify_app_name "$APP" #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) verify_app_name "$APP" diff --git a/plugins/00_dokku-standard/commands b/plugins/00_dokku-standard/commands index 58dd50d51..878690068 100755 --- a/plugins/00_dokku-standard/commands +++ b/plugins/00_dokku-standard/commands @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$PLUGIN_PATH/config/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/config/functions" case "$1" in build) diff --git a/plugins/20_events/commands b/plugins/20_events/commands index c3b817735..4c5b7dea8 100755 --- a/plugins/20_events/commands +++ b/plugins/20_events/commands @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" PLUGIN_DIR="$(dirname $0)" diff --git a/plugins/20_events/hook b/plugins/20_events/hook index 5357e931b..3d4090faf 100755 --- a/plugins/20_events/hook +++ b/plugins/20_events/hook @@ -1,5 +1,5 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" [[ ! "$DOKKU_EVENTS" ]] || dokku_log_pluginhook_call "$(basename $0)" "$@" diff --git a/plugins/20_events/install b/plugins/20_events/install index 8951bd4d1..ec70b44ec 100755 --- a/plugins/20_events/install +++ b/plugins/20_events/install @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" DOKKU_RSYSLOG_FILTER=/etc/rsyslog.d/99-dokku.conf DOKKU_LOGROTATE_FILE=/etc/logrotate.d/dokku diff --git a/plugins/apps/commands b/plugins/apps/commands index 5d407ac89..5e5ab8f98 100755 --- a/plugins/apps/commands +++ b/plugins/apps/commands @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" case "$1" in apps) diff --git a/plugins/apps/post-delete b/plugins/apps/post-delete index b2a5c0cd8..11051a912 100755 --- a/plugins/apps/post-delete +++ b/plugins/apps/post-delete @@ -1,8 +1,8 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -APP="$1"; IMAGE_REPO=$(get_app_image_repo $APP) +source "$PLUGIN_PATH/available/common/functions" +APP="$1"; IMAGE_REPO=$(get_app_image_repo $APP) [[ -n $APP ]] && rm -rf "$DOKKU_ROOT/$APP" > /dev/null # remove all application containers & images diff --git a/plugins/apps/pre-delete b/plugins/apps/pre-delete index a8eb8facb..e9727d6b6 100755 --- a/plugins/apps/pre-delete +++ b/plugins/apps/pre-delete @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG); CACHE_DIR="$DOKKU_ROOT/$APP/cache" verify_app_name "$APP" diff --git a/plugins/build-env/pre-build b/plugins/build-env/pre-build index 98e9afd99..78870aa7b 100755 --- a/plugins/build-env/pre-build +++ b/plugins/build-env/pre-build @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$PLUGIN_PATH/config/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/config/functions" APP="$1"; IMAGE=$(get_app_image_name $APP); BUILD_ENV="" verify_app_name "$APP" diff --git a/plugins/certs/commands b/plugins/certs/commands index 464755643..b74849cd3 100755 --- a/plugins/certs/commands +++ b/plugins/certs/commands @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$(dirname $0)/../common/functions" -source "$(dirname $0)/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/certs/functions" is_tar_import() { [[ -t 0 ]] && return 1 diff --git a/plugins/certs/functions b/plugins/certs/functions index e125c72ed..532087bb1 100755 --- a/plugins/certs/functions +++ b/plugins/certs/functions @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" # returns 'global', 'app', 'false' # if both are configured, app trumps global diff --git a/plugins/checks/check-deploy b/plugins/checks/check-deploy index 85ac68dce..3b8ab3c9a 100755 --- a/plugins/checks/check-deploy +++ b/plugins/checks/check-deploy @@ -35,8 +35,8 @@ # set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$PLUGIN_PATH/config/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/config/functions" APP="$1"; DOKKU_APP_CONTAINER_ID="$2"; DOKKU_APP_CONTAINER_TYPE="$3"; DOKKU_APP_LISTEN_PORT="$4"; DOKKU_APP_LISTEN_IP="$5" if [[ -z "$DOKKU_APP_LISTEN_PORT" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT" ]]; then diff --git a/plugins/config/commands b/plugins/config/commands index 4aaba2b66..b259541ff 100755 --- a/plugins/config/commands +++ b/plugins/config/commands @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$PLUGIN_PATH/config/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/config/functions" case "$1" in config) diff --git a/plugins/config/docker-args-deploy b/plugins/config/docker-args-deploy index f63a2cb5b..2348d820a 100755 --- a/plugins/config/docker-args-deploy +++ b/plugins/config/docker-args-deploy @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$PLUGIN_PATH/config/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/config/functions" STDIN=$(cat); APP="$1"; IMAGE_TAG="$2"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) DOCKERFILE_ENV_FILE="$DOKKU_ROOT/$APP/DOCKERFILE_ENV_FILE" diff --git a/plugins/config/functions b/plugins/config/functions index a07d23fbc..dd69b50bb 100644 --- a/plugins/config/functions +++ b/plugins/config/functions @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" config_export() { local CONFIG_TYPE="$1" diff --git a/plugins/docker-options/commands b/plugins/docker-options/commands index 472b862f4..ac4069fb8 100755 --- a/plugins/docker-options/commands +++ b/plugins/docker-options/commands @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" PHASES=(build deploy run) diff --git a/plugins/domains/commands b/plugins/domains/commands index 2371acf7e..f6863c60f 100755 --- a/plugins/domains/commands +++ b/plugins/domains/commands @@ -1,8 +1,8 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$PLUGIN_PATH/config/functions" -source "$PLUGIN_PATH/domains/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/config/functions" +source "$PLUGIN_PATH/available/domains/functions" RE_IPV4="([0-9]{1,3}[\.]){3}[0-9]{1,3}" diff --git a/plugins/domains/functions b/plugins/domains/functions index f79e889ee..74c1a6ea1 100755 --- a/plugins/domains/functions +++ b/plugins/domains/functions @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$(dirname $0)/../common/functions" +source "$PLUGIN_PATH/available/common/functions" get_app_domains() { local APP=$1; verify_app_name $APP diff --git a/plugins/enter/commands b/plugins/enter/commands index dd5a592ef..1dcceaf3d 100755 --- a/plugins/enter/commands +++ b/plugins/enter/commands @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" case "$1" in enter) diff --git a/plugins/git/commands b/plugins/git/commands index 44b471d9d..ced23cef3 100755 --- a/plugins/git/commands +++ b/plugins/git/commands @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" git_build_app_repo() { verify_app_name "$1" diff --git a/plugins/git/receive-app b/plugins/git/receive-app index 7d51d025d..11dd7541e 100755 --- a/plugins/git/receive-app +++ b/plugins/git/receive-app @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; REV="$2" diff --git a/plugins/nginx-vhosts/bind-external-ip b/plugins/nginx-vhosts/bind-external-ip index f3988c9ae..01f1f57b1 100755 --- a/plugins/nginx-vhosts/bind-external-ip +++ b/plugins/nginx-vhosts/bind-external-ip @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/config/functions" +source "$PLUGIN_PATH/available/config/functions" APP="$1" NO_VHOST=$(config_get $APP NO_VHOST || true) diff --git a/plugins/nginx-vhosts/commands b/plugins/nginx-vhosts/commands index 96a227e64..59703aead 100755 --- a/plugins/nginx-vhosts/commands +++ b/plugins/nginx-vhosts/commands @@ -1,9 +1,9 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$PLUGIN_PATH/certs/functions" -source "$PLUGIN_PATH/config/functions" -source "$PLUGIN_PATH/domains/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/certs/functions" +source "$PLUGIN_PATH/available/config/functions" +source "$PLUGIN_PATH/available/domains/functions" validate_nginx () { set +e diff --git a/plugins/nginx-vhosts/post-deploy b/plugins/nginx-vhosts/post-deploy index 70b033b6e..e29efb5c2 100755 --- a/plugins/nginx-vhosts/post-deploy +++ b/plugins/nginx-vhosts/post-deploy @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$PLUGIN_PATH/config/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/config/functions" APP="$1" if [[ -f "$DOKKU_ROOT/$APP/IP.web.1" ]] && [[ -f "$DOKKU_ROOT/$APP/PORT.web.1" ]]; then diff --git a/plugins/nginx-vhosts/post-domains-update b/plugins/nginx-vhosts/post-domains-update index 945057998..edb88b6f8 100755 --- a/plugins/nginx-vhosts/post-domains-update +++ b/plugins/nginx-vhosts/post-domains-update @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1" diff --git a/plugins/ps/commands b/plugins/ps/commands index b7c5101ec..cdf045996 100755 --- a/plugins/ps/commands +++ b/plugins/ps/commands @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$(dirname $0)/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/ps/functions" case "$1" in ps) diff --git a/plugins/ps/functions b/plugins/ps/functions index c21498f05..b0e3a1091 100755 --- a/plugins/ps/functions +++ b/plugins/ps/functions @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" print_dokku_scale_file() { local APP="$1"; local DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" diff --git a/plugins/ps/pre-deploy b/plugins/ps/pre-deploy index 80488ed13..d80691134 100755 --- a/plugins/ps/pre-deploy +++ b/plugins/ps/pre-deploy @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$(dirname $0)/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/ps/functions" APP="$1" diff --git a/plugins/tags/commands b/plugins/tags/commands index b832212a2..c787840b1 100755 --- a/plugins/tags/commands +++ b/plugins/tags/commands @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" -source "$(dirname $0)/functions" +source "$PLUGIN_PATH/available/common/functions" +source "$PLUGIN_PATH/available/tags/functions" case "$1" in tags) diff --git a/plugins/tags/functions b/plugins/tags/functions index 7dd55157b..155e2778f 100755 --- a/plugins/tags/functions +++ b/plugins/tags/functions @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" tag_image() { docker tag -f "$1" "$2" diff --git a/plugins/tar/commands b/plugins/tar/commands index b751e8772..1032fd5fe 100755 --- a/plugins/tar/commands +++ b/plugins/tar/commands @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" case "$1" in tar-from|tar:from) diff --git a/plugins/tar/receive-app b/plugins/tar/receive-app index 0bf09425b..88e6525a8 100755 --- a/plugins/tar/receive-app +++ b/plugins/tar/receive-app @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x -source "$PLUGIN_PATH/common/functions" +source "$PLUGIN_PATH/available/common/functions" APP="$1"; REV="$2" diff --git a/tests/unit/core_ports.bats b/tests/unit/core_ports.bats index 696159ce8..fbfa297e8 100644 --- a/tests/unit/core_ports.bats +++ b/tests/unit/core_ports.bats @@ -165,7 +165,7 @@ check_urls() { } @test "(core) port exposure (dockerfile raw port)" { - source "$PLUGIN_PATH/common/functions" + source "$PLUGIN_PATH/available/common/functions" cat< $DOCKERFILE EXPOSE 3001/udp EXPOSE 3003 @@ -178,7 +178,7 @@ EOF } @test "(core) port exposure (dockerfile tcp port)" { - source "$PLUGIN_PATH/common/functions" + source "$PLUGIN_PATH/available/common/functions" cat< $DOCKERFILE EXPOSE 3001/udp EXPOSE 3000/tcp