initial pass at switching to plugn

This commit is contained in:
Michael Hobbs authored and Jose Diaz-Gonzalez committed 2015-09-15 02:16:40 -07:00
1 parent ac75c726ad
commit 7a545759f2
33 files changed
+163 -91

No files matched your search

+10 -9
View File
@@ -1,7 +1,7 @@
DOKKU_VERSION = master DOKKU_VERSION = master
SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand 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 STACK_URL ?= https://github.com/gliderlabs/herokuish.git
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
DOKKU_LIB_ROOT ?= /var/lib/dokku DOKKU_LIB_ROOT ?= /var/lib/dokku
@@ -23,7 +23,7 @@ else
BUILD_STACK_TARGETS = build-in-docker BUILD_STACK_TARGETS = build-in-docker
endif 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 tests.mk
include deb.mk include deb.mk
@@ -50,10 +50,11 @@ copyfiles:
mkdir -p ${CORE_PLUGINS_PATH} ${PLUGINS_PATH} ${DISABLED_PLUGINS_PATH} mkdir -p ${CORE_PLUGINS_PATH} ${PLUGINS_PATH} ${DISABLED_PLUGINS_PATH}
rm -rf ${CORE_PLUGINS_PATH}/* rm -rf ${CORE_PLUGINS_PATH}/*
find plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read plugin; do \ 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 ${CORE_PLUGINS_PATH}/$$plugin && \
rm -rf ${PLUGINS_PATH}/$$plugin && \ rm -rf ${PLUGINS_PATH}/$$plugin && \
cp -R plugins/$$plugin ${CORE_PLUGINS_PATH} && \ 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 done
chown dokku:dokku -R ${PLUGINS_PATH} ${CORE_PLUGINS_PATH} ${DISABLED_PLUGINS_PATH} chown dokku:dokku -R ${PLUGINS_PATH} ${CORE_PLUGINS_PATH} ${DISABLED_PLUGINS_PATH}
$(MAKE) addman $(MAKE) addman
@@ -66,13 +67,13 @@ addman:
version: version:
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/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 dokku plugins-install-dependencies --core
plugins: pluginhook docker plugins: plugn docker
dokku plugins-install --core 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 $(MAKE) -e stack
apt-update: apt-update:
@@ -89,9 +90,9 @@ sshcommand:
chmod +x /usr/local/bin/sshcommand chmod +x /usr/local/bin/sshcommand
sshcommand create dokku /usr/local/bin/dokku sshcommand create dokku /usr/local/bin/dokku
pluginhook: plugn:
wget -qO /tmp/pluginhook_0.1.0_amd64.deb ${PLUGINHOOK_URL} wget -qO /tmp/plugn_latest.tgz ${PLUGN_URL}
dpkg -i /tmp/pluginhook_0.1.0_amd64.deb tar xzf /tmp/plugn_latest.tgz -C /usr/local/bin
docker: aufs docker: aufs
apt-get install -qq -y curl apt-get install -qq -y curl
+13 -15
View File
@@ -16,7 +16,7 @@ export DOKKU_VALID_EXIT=0
export DOKKU_LOGS_DIR=${DOKKU_LOGS_DIR:="/var/log/dokku"} export DOKKU_LOGS_DIR=${DOKKU_LOGS_DIR:="/var/log/dokku"}
export DOKKU_EVENTS_LOGFILE=${DOKKU_EVENTS_LOGFILE:="$DOKKU_LOGS_DIR/events.log"} 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 [[ -f $DOKKU_ROOT/dokkurc ]] && source $DOKKU_ROOT/dokkurc
[[ -d $DOKKU_ROOT/.dokkurc ]] && for f in $DOKKU_ROOT/.dokkurc/*; do source $f; done [[ -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" [[ -z $2 ]] && dokku_log_fail "Please specify an app to deploy"
APP="$2"; IMAGE_TAG="$3"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG) APP="$2"; IMAGE_TAG="$3"; IMAGE=$(get_app_image_name $APP $IMAGE_TAG)
verify_app_name "$APP" 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 is_image_herokuish_based "$IMAGE" && DOKKU_HEROKUISH=true
DOKKU_SCALE_FILE="$DOKKU_ROOT/$APP/DOKKU_SCALE" 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" DOKKU_PORT_FILE="$DOKKU_ROOT/$APP/PORT.$PROC_TYPE.$CONTAINER_INDEX"
# start the app # 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+=" -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 " [[ "$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" [[ -n "$DOKKU_HEROKUISH" ]] && START_CMD="/start $PROC_TYPE"
@@ -133,7 +133,7 @@ case "$1" in
else else
trap kill_new INT TERM EXIT trap kill_new INT TERM EXIT
dokku_log_info1 "Running pre-flight checks" 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 trap - INT TERM EXIT
fi fi
@@ -161,7 +161,7 @@ case "$1" in
done < "$DOKKU_SCALE_FILE" done < "$DOKKU_SCALE_FILE"
dokku_log_info1 "Running post-deploy" dokku_log_info1 "Running post-deploy"
pluginhook post-deploy $APP $port $ipaddr plugn trigger post-deploy $APP $port $ipaddr
# kill the old container # kill the old container
if [[ -n "$oldids" ]]; then if [[ -n "$oldids" ]]; then
@@ -202,27 +202,25 @@ case "$1" in
;; ;;
plugins) plugins)
for plugin in "$PLUGIN_PATH"/*/; do plugn list
basename "$plugin"
done
;; ;;
plugins-install) plugins-install)
if [[ $2 == "--core" ]]; then if [[ $2 == "--core" ]]; then
export PLUGIN_PATH="$PLUGIN_CORE_PATH" export PLUGIN_PATH="$PLUGIN_CORE_PATH"
fi fi
pluginhook install plugn trigger install
;; ;;
plugins-install-dependencies) plugins-install-dependencies)
if [[ $2 == "--core" ]]; then if [[ $2 == "--core" ]]; then
export PLUGIN_PATH="$PLUGIN_CORE_PATH" export PLUGIN_PATH="$PLUGIN_CORE_PATH"
fi fi
pluginhook dependencies plugn trigger dependencies
;; ;;
plugins-update) plugins-update)
pluginhook update plugn trigger update
;; ;;
plugins:disable) plugins:disable)
@@ -253,7 +251,7 @@ case "$1" in
echo "" echo ""
echo "Options:" 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 help, Print the list of commands
plugins, Print active plugins plugins, Print active plugins
plugins-install [--core], Install active plugins (or only core ones) plugins-install [--core], Install active plugins (or only core ones)
@@ -266,7 +264,7 @@ EOF
*) *)
implemented=0 implemented=0
for script in $PLUGIN_PATH/*/commands; do for script in $PLUGIN_PATH/enabled/*/commands; do
set +e; $script "$@" ; exit_code=$? ; set -e set +e; $script "$@" ; exit_code=$? ; set -e
if [[ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]]; then if [[ "$exit_code" -eq "$DOKKU_NOT_IMPLEMENTED_EXIT" ]]; then
continue continue
+31 -30
View File
@@ -19,39 +19,39 @@ case "$1" in
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
[[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR [[ -d $CACHE_DIR ]] || mkdir $CACHE_DIR
# *DEPRECATED* in v0.3.15: `pluginhook pre-build` will be removed in future releases # *DEPRECATED* in v0.3.15: `plugn trigger pre-build` will be removed in future releases
pluginhook pre-build "$APP" plugn trigger pre-build "$APP"
# *DEPRECATED* in v0.3.22: `pluginhook pre-build-buildstep` will be removed in future releases # *DEPRECATED* in v0.3.22: `plugn trigger pre-build-buildstep` will be removed in future releases
pluginhook pre-build-buildstep "$APP" plugn trigger pre-build-buildstep "$APP"
pluginhook pre-build-buildpack "$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 # https://github.com/progrium/dokku/issues/896 & https://github.com/progrium/dokku/issues/906
DOCKER_ARGS=$(: | pluginhook docker-args $APP build) DOCKER_ARGS=$(: | plugn trigger docker-args $APP build)
DOCKER_ARGS+=$(: | pluginhook docker-args-build $APP) DOCKER_ARGS+=$(: | plugn trigger docker-args-build $APP)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true " [[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
id=$(docker run -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build) id=$(docker run -d -v $CACHE_DIR:/cache -e CACHE_PATH=/cache $DOCKER_ARGS $IMAGE /build)
docker attach $id docker attach $id
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
# *DEPRECATED* in v0.3.15: `pluginhook post-build` will be removed in future releases # *DEPRECATED* in v0.3.15: `plugn trigger post-build` will be removed in future releases
pluginhook post-build "$APP" plugn trigger post-build "$APP"
# *DEPRECATED* in v0.3.22: `pluginhook post-build-buildstep` will be removed in future releases # *DEPRECATED* in v0.3.22: `plugn trigger post-build-buildstep` will be removed in future releases
pluginhook post-build-buildstep "$APP" plugn trigger post-build-buildstep "$APP"
pluginhook post-build-buildpack "$APP" plugn trigger post-build-buildpack "$APP"
;; ;;
dockerfile) dockerfile)
# extract first port from Dockerfile # extract first port from Dockerfile
DOCKERFILE_PORT=$(get_dockerfile_exposed_port Dockerfile) DOCKERFILE_PORT=$(get_dockerfile_exposed_port Dockerfile)
[[ -n "$DOCKERFILE_PORT" ]] && config_set --no-restart $APP DOKKU_DOCKERFILE_PORT=$DOCKERFILE_PORT [[ -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" [[ "$DOKKU_DOCKERFILE_CACHE_BUILD" == "false" ]] && DOKKU_DOCKER_BUILD_OPTS="$DOKKU_DOCKER_BUILD_OPTS --no-cache"
docker build $DOKKU_DOCKER_BUILD_OPTS -t "$IMAGE" . 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 case "$IMAGE_SOURCE_TYPE" in
herokuish) herokuish)
# *DEPRECATED* in v0.3.15: `pluginhook pre-release` will be removed in future releases # *DEPRECATED* in v0.3.15: `plugn trigger pre-release` will be removed in future releases
pluginhook pre-release $APP $IMAGE_TAG plugn trigger pre-release "$APP" "$IMAGE_TAG"
# *DEPRECATED* in v0.3.22: `pluginhook pre-release-buildstep` will be removed in future releases # *DEPRECATED* in v0.3.22: `plugn trigger pre-release-buildstep` will be removed in future releases
pluginhook pre-release-buildstep $APP $IMAGE_TAG plugn trigger pre-release-buildstep "$APP" "$IMAGE_TAG"
pluginhook pre-release-buildpack $APP $IMAGE_TAG plugn trigger pre-release-buildpack "$APP" "$IMAGE_TAG"
if [[ -n $(config_export global) ]]; then 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") 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 test "$(docker wait $id)" -eq 0
@@ -81,16 +81,17 @@ case "$1" in
test "$(docker wait $id)" -eq 0 test "$(docker wait $id)" -eq 0
docker commit $id $IMAGE > /dev/null docker commit $id $IMAGE > /dev/null
fi fi
# *DEPRECATED* in v0.3.15: `pluginhook post-release` will be removed in future releases # *DEPRECATED* in v0.3.15: `plugn trigger post-release` will be removed in future releases
pluginhook post-release $APP $IMAGE_TAG plugn trigger post-release "$APP" "$IMAGE_TAG"
# *DEPRECATED* in v0.3.22: `pluginhook post-release-buildstep` will be removed in future releases # *DEPRECATED* in v0.3.22: `plugn trigger post-release-buildstep` will be removed in future releases
pluginhook post-release-buildstep $APP $IMAGE_TAG plugn trigger post-release-buildstep "$APP" "$IMAGE_TAG"
pluginhook post-release-buildpack $APP $IMAGE_TAG plugn trigger post-release-buildpack "$APP" "$IMAGE_TAG"
;; ;;
dockerfile) dockerfile)
pluginhook pre-release-dockerfile $APP $IMAGE_TAG # buildstep plugins don't necessarily make sense for dockerfiles. call the new breed!!!
pluginhook post-release-dockerfile $APP $IMAGE_TAG 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 shift 2
DOCKER_ARGS=$(: | pluginhook docker-args $APP run $IMAGE_TAG) DOCKER_ARGS=$(: | plugn trigger docker-args $APP run $IMAGE_TAG)
DOCKER_ARGS+=$(: | pluginhook docker-args-run $APP $IMAGE_TAG) DOCKER_ARGS+=$(: | plugn trigger docker-args-run $APP $IMAGE_TAG)
[[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true " [[ "$DOKKU_TRACE" ]] && DOCKER_ARGS+=" -e TRACE=true "
[[ $DOKKU_RM_CONTAINER ]] && DOKKU_RUN_OPTS="--rm" [[ $DOKKU_RM_CONTAINER ]] && DOKKU_RUN_OPTS="--rm"
has_tty && DOKKU_RUN_OPTS+=" -i -t" has_tty && DOKKU_RUN_OPTS+=" -i -t"
@@ -222,7 +223,7 @@ case "$1" in
;; ;;
help) help)
cat && cat<<EOF cat<<EOF
ls, Pretty listing of deployed applications and containers ls, Pretty listing of deployed applications and containers
logs <app> [-t], Show the last logs for an application (-t follows) logs <app> [-t], Show the last logs for an application (-t follows)
run <app> <cmd>, Run a command in the environment of an application run <app> <cmd>, Run a command in the environment of an application
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core standard plugin"
version = "0.4.0"
[plugin.config]
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core events logging plugin"
version = "0.4.0"
[plugin.config]
+3 -3
View File
@@ -38,7 +38,7 @@ case "$1" in
echo "Destroying $APP (including all add-ons)" 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) DOKKU_APP_CIDS=$(get_app_container_ids $APP)
if [[ -n $DOKKU_APP_CIDS ]]; then if [[ -n $DOKKU_APP_CIDS ]]; then
for ID in $DOKKU_APP_CIDS;do for ID in $DOKKU_APP_CIDS;do
@@ -47,11 +47,11 @@ case "$1" in
done done
fi fi
pluginhook post-delete $APP $IMAGE_TAG plugn trigger post-delete $APP $IMAGE_TAG
;; ;;
help | apps:help) help | apps:help)
cat && cat<<EOF cat<<EOF
apps, List your apps apps, List your apps
apps:create <app>, Create a new app apps:create <app>, Create a new app
apps:destroy <app>, Permanently destroy an app apps:destroy <app>, Permanently destroy an app
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core apps plugin"
version = "0.4.0"
[plugin.config]
+4 -4
View File
@@ -11,7 +11,7 @@ case "$1" in
BACKUP_TMP_DIR=$(mktemp -d) BACKUP_TMP_DIR=$(mktemp -d)
BACKUP_TMP_FILE="$BACKUP_TMP_DIR/backup.tar" 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 pushd $BACKUP_DIR > /dev/null
find . -maxdepth 1 -type d -not -name . | sed 's:./::g' > "$BACKUP_TMP_DIR/.dokku_backup_apps" 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" BACKUP_ROOT="$BACKUP_TMP_DIR""$DOKKU_ROOT"
TARGET_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 if $force; then
echo "-f used. Ignoring warnings." echo "-f used. Ignoring warnings."
else 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 while read app; do mkdir "$TARGET_DIR/$app"; echo "Imported $app"; done < $BACKUP_TMP_DIR/.dokku_backup_apps
# have the plugins import their stuff # 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 rm -rf $BACKUP_TMP_DIR
@@ -83,7 +83,7 @@ case "$1" in
;; ;;
help | backup:help) help | backup:help)
cat && cat<<EOF cat<<EOF
backup:export [file], Export dokku configuration files backup:export [file], Export dokku configuration files
backup:import [file], Import dokku configuration files backup:import [file], Import dokku configuration files
EOF EOF
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core backup plugin"
version = "0.4.0"
[plugin.config]
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core build-env plugin"
version = "0.4.0"
[plugin.config]
+1 -1
View File
@@ -144,7 +144,7 @@ case "$1" in
if [[ -d "$APP_SSL_PATH" ]]; then if [[ -d "$APP_SSL_PATH" ]]; then
dokku_log_info1 "Removing SSL endpoint from $APP" dokku_log_info1 "Removing SSL endpoint from $APP"
rm -rf $APP_SSL_PATH rm -rf $APP_SSL_PATH
pluginhook post-domains-update $APP plugn trigger post-domains-update $APP
else else
dokku_log_info1 "An app-specific SSL endpoint is not defined" dokku_log_info1 "An app-specific SSL endpoint is not defined"
fi fi
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core certificate management plugin"
version = "0.4.0"
[plugin.config]
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core checks plugin"
version = "0.4.0"
[plugin.config]
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core common plugin"
version = "0.4.0"
[plugin.config]
+1 -1
View File
@@ -33,7 +33,7 @@ case "$1" in
;; ;;
help | config:help) help | config:help)
cat && cat<<EOF cat<<EOF
config (<app>|--global), Display all global or app-specific config vars 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: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 config:set (<app>|--global) KEY1=VALUE1 [KEY2=VALUE2 ...], Set one or more config vars
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core config plugin"
version = "0.4.0"
[plugin.config]
+1 -1
View File
@@ -140,7 +140,7 @@ case "$1" in
# Display usage help # Display usage help
help) help)
cat && cat<<EOF cat<<EOF
docker-options <app>, Display apps docker options for all phases 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 <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) docker-options:add <app> <phase(s)> OPTION, Add docker option to app for phase (comma separated phase list)
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core docker-options plugin"
version = "0.4.0"
[plugin.config]
+5 -5
View File
@@ -57,7 +57,7 @@ case "$1" in
if [[ -f "$DOKKU_ROOT/VHOST" ]]; then if [[ -f "$DOKKU_ROOT/VHOST" ]]; then
dokku_log_info1 "Creating new $VHOST_PATH..." dokku_log_info1 "Creating new $VHOST_PATH..."
SUBDOMAIN=${APP/%\.${VHOST}/} SUBDOMAIN=${APP/%\.${VHOST}/}
hostname=$(: | pluginhook nginx-hostname $APP $SUBDOMAIN $VHOST) hostname=$(: | plugn trigger nginx-hostname $APP $SUBDOMAIN $VHOST)
if [[ ! -n $hostname ]]; then if [[ ! -n $hostname ]]; then
if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then if [[ "$APP" == *.* ]] && [[ "$SUBDOMAIN" == "$APP" ]]; then
hostname="${APP/\//-}" hostname="${APP/\//-}"
@@ -95,7 +95,7 @@ case "$1" in
done done
# we need to restart the app to make sure we're binding to the appropriate network interface # we need to restart the app to make sure we're binding to the appropriate network interface
dokku nginx:build-config $APP dokku nginx:build-config $APP
pluginhook post-domains-update $APP plugn trigger post-domains-update $APP
for DOMAIN in "$@";do for DOMAIN in "$@";do
dokku_log_info1 "Added $DOMAIN to $APP" dokku_log_info1 "Added $DOMAIN to $APP"
done done
@@ -109,7 +109,7 @@ case "$1" in
rm -f "$DOKKU_ROOT/$APP/VHOST" rm -f "$DOKKU_ROOT/$APP/VHOST"
dokku domains:setup $APP dokku domains:setup $APP
pluginhook post-domains-update $APP plugn trigger post-domains-update $APP
dokku_log_info1 "Cleared domains in $APP" dokku_log_info1 "Cleared domains in $APP"
;; ;;
@@ -130,7 +130,7 @@ case "$1" in
for DOMAIN in "$@";do for DOMAIN in "$@";do
sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST" sed -i "/^$DOMAIN$/d" "$DOKKU_ROOT/$APP/VHOST"
done done
pluginhook post-domains-update $APP plugn trigger post-domains-update $APP
for DOMAIN in "$@";do for DOMAIN in "$@";do
dokku_log_info1 "Removed $DOMAIN from $APP" dokku_log_info1 "Removed $DOMAIN from $APP"
done done
@@ -138,7 +138,7 @@ case "$1" in
;; ;;
help | domains:help) help | domains:help)
cat && cat<<EOF cat<<EOF
domains <app>, List custom domains for app domains <app>, List custom domains for app
domains:add <app> DOMAIN, Add a custom domain to app domains:add <app> DOMAIN, Add a custom domain to app
domains:clear <app>, Clear all custom domains for app domains:clear <app>, Clear all custom domains for app
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core domains plugin"
version = "0.4.0"
[plugin.config]
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core enter plugin"
version = "0.4.0"
[plugin.config]
+6 -6
View File
@@ -36,11 +36,11 @@ case "$1" in
# Only run this script for the master branch. You can remove this # 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 block if you wish to run it for others as well.
if [[ $refname = "refs/heads/master" ]] ; then if [[ $refname = "refs/heads/master" ]] ; then
# broken out into pluginhook so we might support other methods to receive an app # broken out into plugin so we might support other methods to receive an app
pluginhook -p receive-app $APP $newrev plugn trigger receive-app $APP $newrev
else else
if test -f "$PLUGIN_PATH"/enabled/*/receive-branch; then if test -f "$PLUGIN_PATH"/enabled/*/receive-branch; then
pluginhook receive-branch $APP $newrev $refname plugn trigger receive-branch $APP $newrev $refname
else else
echo $'\e[1G\e[K'"-----> WARNING: deploy did not complete, you must push to master." 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'" 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) git-upload-pack)
APP="$(echo $2 | perl -pe 's/(?<!\\)'\''//g' | sed 's/\\'\''/'\''/g')" 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" cat | git-upload-pack "$DOKKU_ROOT/$APP"
pluginhook git-post-pull $APP plugn trigger git-post-pull $APP
;; ;;
git-build) git-build)
@@ -100,7 +100,7 @@ EOF
;; ;;
help | git:help) help | git:help)
cat echo -n ""
;; ;;
*) *)
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core git plugin"
version = "0.4.0"
[plugin.config]
+2 -2
View File
@@ -130,7 +130,7 @@ EOF
if is_deployed "$APP"; then if is_deployed "$APP"; then
dokku_log_info1 "Running nginx-pre-reload" 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" dokku_log_verbose "Reloading nginx"
validate_nginx && restart_nginx validate_nginx && restart_nginx
@@ -160,7 +160,7 @@ EOF
fi fi
;; ;;
help | nginx:help) help | nginx:help)
cat && cat<<EOF cat<<EOF
nginx:build-config <app>, (Re)builds nginx config for given app nginx:build-config <app>, (Re)builds nginx config for given app
EOF EOF
;; ;;
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core nginx-vhosts plugin"
version = "0.4.0"
[plugin.config]
+10 -10
View File
@@ -14,7 +14,7 @@ case "$1" in
dokku_log_info1_quiet "running processes in container: $CID" dokku_log_info1_quiet "running processes in container: $CID"
docker exec $DOKKU_RUN_OPTS $CID /bin/sh -c "ps auxwww" docker exec $DOKKU_RUN_OPTS $CID /bin/sh -c "ps auxwww"
done done
;; ;;
ps:start) ps:start)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
@@ -28,7 +28,7 @@ case "$1" in
else else
echo "App $APP already running" echo "App $APP already running"
fi fi
;; ;;
ps:stop) ps:stop)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
@@ -43,14 +43,14 @@ case "$1" in
else else
echo "App $APP already stopped" echo "App $APP already stopped"
fi fi
;; ;;
ps:rebuild) ps:rebuild)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
APP="$2"; verify_app_name "$APP" APP="$2"; verify_app_name "$APP"
pluginhook -p receive-app $APP plugn trigger receive-app $APP
;; ;;
ps:rebuildall) ps:rebuildall)
shopt -s nullglob shopt -s nullglob
@@ -60,7 +60,7 @@ case "$1" in
is_deployed $APP && dokku ps:rebuild $APP is_deployed $APP && dokku ps:rebuild $APP
done done
shopt -u nullglob shopt -u nullglob
;; ;;
ps:restart) ps:restart)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -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 ! (is_deployed $APP) && echo "App $APP has not been deployed" && exit 0
release_and_deploy "$APP" "$IMAGE_TAG" release_and_deploy "$APP" "$IMAGE_TAG"
;; ;;
ps:restartall) ps:restartall)
shopt -s nullglob shopt -s nullglob
@@ -80,7 +80,7 @@ case "$1" in
dokku ps:restart $APP dokku ps:restart $APP
done done
shopt -u nullglob shopt -u nullglob
;; ;;
ps:scale) ps:scale)
[[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on" [[ -z $2 ]] && dokku_log_fail "Please specify an app to run the command on"
@@ -98,10 +98,10 @@ case "$1" in
set_scale "$APP" "$@" set_scale "$APP" "$@"
release_and_deploy "$APP" "$IMAGE_TAG" release_and_deploy "$APP" "$IMAGE_TAG"
fi fi
;; ;;
help | ps:help) help | ps:help)
cat && cat<<EOF cat<<EOF
ps <app>, List processes running in app container(s) 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:scale <app> <proc>=<count> [<proc>=<count>], Set how many instances of a given process to run
ps:start <app>, Start app container(s) ps:start <app>, Start app container(s)
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core ps plugin"
version = "0.4.0"
[plugin.config]
+1 -1
View File
@@ -47,7 +47,7 @@ case "$1" in
;; ;;
help | shell:help) help | shell:help)
cat && cat<<EOF cat<<EOF
shell, Spawn dokku shell shell, Spawn dokku shell
EOF EOF
;; ;;
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core shell plugin"
version = "0.4.0"
[plugin.config]
+2 -2
View File
@@ -20,7 +20,7 @@ case "$1" in
tag_image "$IMAGE_REPO:latest" "$IMAGE_REPO:$IMAGE_TAG" tag_image "$IMAGE_REPO:latest" "$IMAGE_REPO:$IMAGE_TAG"
dokku_log_info2_quiet "Added $IMAGE_TAG tag to $IMAGE_REPO" 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) tags:deploy)
@@ -45,7 +45,7 @@ case "$1" in
docker rmi "$IMAGE_REPO:$IMAGE_TAG" docker rmi "$IMAGE_REPO:$IMAGE_TAG"
;; ;;
esac esac
pluginhook tags-destroy $APP $IMAGE_TAG plugn trigger tags-destroy $APP $IMAGE_TAG
;; ;;
help | tags:help) help | tags:help)
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core tags plugin"
version = "0.4.0"
[plugin.config]
+1 -1
View File
@@ -15,7 +15,7 @@ case "$1" in
APP="$2" APP="$2"
verify_app_name "$2" verify_app_name "$2"
tee "$DOKKU_ROOT/$APP/src.tar" | wc -c tee "$DOKKU_ROOT/$APP/src.tar" | wc -c
pluginhook -p receive-app $APP plugn trigger -p receive-app $APP
;; ;;
tar-build) tar-build)
+4
View File
@@ -0,0 +1,4 @@
[plugin]
description = "dokku core tar plugin"
version = "0.4.0"
[plugin.config]