这是indexloc提供的服务,不要输入任何密码
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ SSHCOMMAND_URL ?= https://raw.github.com/progrium/sshcommand/master/sshcommand
PLUGINHOOK_URL ?= https://s3.amazonaws.com/progrium-pluginhook/pluginhook_0.1.0_amd64.deb
STACK_URL ?= https://github.com/gliderlabs/herokuish.git
PREBUILT_STACK_URL ?= gliderlabs/herokuish:latest
PLUGINS_PATH ?= /var/lib/dokku/plugins
DOKKU_LIB_ROOT ?= /var/lib/dokku
PLUGINS_PATH ?= ${DOKKU_LIB_ROOT}/plugins
CORE_PLUGINS_PATH ?= ${DOKKU_LIB_ROOT}/core-plugins
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is never changed in the debian packaging, so we can't merge this...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How so? Why couldn’t you update the Makefile?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the debian packaging doesn't use a makefile...

DISABLED_PLUGINS_PATH ?= ${DOKKU_LIB_ROOT}/disabled-plugins

# If the first argument is "vagrant-dokku"...
ifeq (vagrant-dokku,$(firstword $(MAKECMDGOALS)))
Expand Down Expand Up @@ -44,13 +47,15 @@ packer:

copyfiles:
cp dokku /usr/local/bin/dokku
mkdir -p ${PLUGINS_PATH}
find ${PLUGINS_PATH} -mindepth 2 -maxdepth 2 -name '.core' -printf '%h\0' | xargs -0 rm -Rf
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}/$$plugin && \
cp -R plugins/$$plugin ${PLUGINS_PATH} && \
touch ${PLUGINS_PATH}/$$plugin/.core; \
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}; \
done
chown dokku:dokku -R ${PLUGINS_PATH} ${CORE_PLUGINS_PATH} ${DISABLED_PLUGINS_PATH}
$(MAKE) addman

addman:
Expand All @@ -62,10 +67,10 @@ version:
git describe --tags > ~dokku/VERSION 2> /dev/null || echo '~${DOKKU_VERSION} ($(shell date -uIminutes))' > ~dokku/VERSION

plugin-dependencies: pluginhook
dokku plugins-install-dependencies
dokku plugins-install-dependencies --core

plugins: pluginhook docker
dokku plugins-install
dokku plugins-install --core

dependencies: apt-update sshcommand pluginhook docker help2man man-db
$(MAKE) -e stack
Expand Down
2 changes: 1 addition & 1 deletion debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ case "$1" in
sshcommand create dokku /usr/local/bin/dokku
egrep -i "^docker" /etc/group || groupadd docker
usermod -aG docker dokku
dokku plugins-install
dokku plugins-install --core
rm -f /home/dokku/VERSION
cp /var/lib/dokku/STABLE_VERSION /home/dokku/VERSION

Expand Down
37 changes: 34 additions & 3 deletions dokku
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ shopt -s nullglob
export DOKKU_DISTRO=${DOKKU_DISTRO:="ubuntu"}
export DOKKU_IMAGE=${DOKKU_IMAGE:="gliderlabs/herokuish"}
export DOKKU_ROOT=${DOKKU_ROOT:=~dokku}
export DOKKU_LIB_ROOT=${DOKKU_LIB_PATH:="/var/lib/dokku"}

export PLUGIN_PATH=${PLUGIN_PATH:="/var/lib/dokku/plugins"}
export PLUGIN_PATH=${PLUGIN_PATH:="$DOKKU_LIB_ROOT/plugins"}
export PLUGIN_CORE_PATH=${PLUGIN_CORE_PATH:="$DOKKU_LIB_ROOT/core-plugins"}
export PLUGIN_DISABLED_PATH=${PLUGIN_DISABLED_PATH:="$DOKKU_LIB_ROOT/disabled-plugins"}
export DOKKU_NOT_IMPLEMENTED_EXIT=10
export DOKKU_VALID_EXIT=0

Expand Down Expand Up @@ -196,21 +199,46 @@ case "$1" in
;;

plugins)
ls -1 -d $PLUGIN_PATH/*/
for plugin in "$PLUGIN_PATH"/*/; do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here I did this since I think outputting only the name of the plugins is more useful than the complete path. I might be wrong 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably will need to change with plugn, right @michaelshobbs ?

basename "$plugin"
done
;;

plugins-install)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think plugins-install (and plugins-install-dependencies, plugins-update) should be renamed plugins:install to follow the convention used everywhere else.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

if [[ $2 == "--core" ]]; then
export PLUGIN_PATH="$PLUGIN_CORE_PATH"
fi
pluginhook install
;;

plugins-install-dependencies)
if [[ $2 == "--core" ]]; then
export PLUGIN_PATH="$PLUGIN_CORE_PATH"
fi
pluginhook dependencies
;;

plugins-update)
pluginhook update
;;

plugins:disable)
PLUGIN="$2"
[[ -e $PLUGIN_CORE_PATH/$PLUGIN ]] && echo "Cannot disable a core plugin" && exit 1
[[ -e $PLUGIN_DISABLED_PATH/$PLUGIN ]] && echo "Plugin already disabled" && exit 1
[[ ! -e $PLUGIN_PATH/$PLUGIN ]] && echo "Plugin does not exist" && exit 1
mv "$PLUGIN_PATH/$PLUGIN" "$PLUGIN_DISABLED_PATH"
echo "Plugin $PLUGIN disabled"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this should all be done via plugn, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but if we're going to have two enabled places then we'll need to manage the plugin path ourselves somehow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still some unknowns for me about how this plays along with plugn. Another reason I'd like to pull it into the plugn branch and play around with it. Anyone opposed to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope

;;

plugins:enable)
PLUGIN="$2"
[[ -e $PLUGIN_PATH/$PLUGIN ]] && echo "Plugin already enabled" && exit 1
[[ ! -e $PLUGIN_DISABLED_PATH/$PLUGIN ]] && echo "Plugin does not exist" && exit 1
mv "$PLUGIN_DISABLED_PATH/$PLUGIN" "$PLUGIN_PATH"
echo "Plugin $PLUGIN enabled"
;;

# DEPRECATED as of v0.3.14
deploy:all)
echo "*DEPRECATED* in v0.3.14: deploy:all will be removed in future versions"
Expand All @@ -225,8 +253,11 @@ case "$1" in
cat<<EOF | pluginhook commands help | sort | column -c2 -t -s,
help, Print the list of commands
plugins, Print active plugins
plugins-install, Install active plugins
plugins-install [--core], Install active plugins (or only core ones)
plugins-install-dependencies [--core], Install active plugins dependencies (or only core ones)
plugins-update, Update active plugins
plugins:enable <name>, Enable a previously disabled plugin
plugins:disable <name>, Disable an installed plugin (third-party only)
EOF
;;

Expand Down