Enable debugging support to debian postinst hook
It is now possible to turn on debugging during an apt-get run by using `TRACE=1`
This commit is contained in:
1 parent
07506f1f53
commit
908f551e0f
1 file changed
+7
-5
Vendored
+7
-5
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -e
|
set -eo pipefail; [[ $TRACE ]] && set -x
|
||||||
|
|
||||||
. /usr/share/debconf/confmodule
|
. /usr/share/debconf/confmodule
|
||||||
|
|
||||||
@@ -18,13 +18,13 @@ case "$1" in
|
|||||||
egrep -i "^docker" /etc/group || groupadd docker
|
egrep -i "^docker" /etc/group || groupadd docker
|
||||||
usermod -aG docker dokku
|
usermod -aG docker dokku
|
||||||
|
|
||||||
# setup plugin directories
|
echo "setup plugin directories"
|
||||||
# should be replaced by `plugn init`
|
# should be replaced by `plugn init`
|
||||||
mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/available ${DOKKU_LIB_ROOT}/plugins/available
|
mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/available ${DOKKU_LIB_ROOT}/plugins/available
|
||||||
mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/enabled ${DOKKU_LIB_ROOT}/plugins/enabled
|
mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/enabled ${DOKKU_LIB_ROOT}/plugins/enabled
|
||||||
touch ${DOKKU_LIB_ROOT}/core-plugins/config.toml ${DOKKU_LIB_ROOT}/plugins/config.toml
|
touch ${DOKKU_LIB_ROOT}/core-plugins/config.toml ${DOKKU_LIB_ROOT}/plugins/config.toml
|
||||||
|
|
||||||
# migrate old plugins
|
echo "migrate old plugins"
|
||||||
find ${DOKKU_LIB_ROOT}/plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
|
find ${DOKKU_LIB_ROOT}/plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
|
||||||
if [ "$plugin" = "available" ] || [ "$plugin" = "enabled" ]; then
|
if [ "$plugin" = "available" ] || [ "$plugin" = "enabled" ]; then
|
||||||
continue
|
continue
|
||||||
@@ -35,7 +35,7 @@ case "$1" in
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# enable all core plugins
|
echo "enable all core plugins"
|
||||||
find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
|
find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do
|
||||||
if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
|
if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then
|
||||||
ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin;
|
ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin;
|
||||||
@@ -45,11 +45,13 @@ case "$1" in
|
|||||||
done
|
done
|
||||||
chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins
|
chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins
|
||||||
|
|
||||||
|
echo "install all core plugins"
|
||||||
dokku plugin:install --core
|
dokku plugin:install --core
|
||||||
|
|
||||||
rm -f ${DOKKU_ROOT}/VERSION
|
rm -f ${DOKKU_ROOT}/VERSION
|
||||||
cp ${DOKKU_LIB_ROOT}/STABLE_VERSION ${DOKKU_ROOT}/VERSION
|
cp ${DOKKU_LIB_ROOT}/STABLE_VERSION ${DOKKU_ROOT}/VERSION
|
||||||
|
|
||||||
|
echo "starting dokku-installer if necessary"
|
||||||
if [ -f /etc/init/dokku-installer.conf ] && service dokku-installer status 2> /dev/null | grep waiting; then
|
if [ -f /etc/init/dokku-installer.conf ] && service dokku-installer status 2> /dev/null | grep waiting; then
|
||||||
sudo service dokku-installer start
|
sudo service dokku-installer start
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in new issue
Block a user