From dc16792bed9fdf157d0a8eae8e6c6d4191557b39 Mon Sep 17 00:00:00 2001 From: Daniel Del Rio Figueira Date: Thu, 29 Apr 2021 17:52:31 +0200 Subject: [PATCH] Changed: allow check_subscription to fail before installing passbolt --- debian/bin/docker-entrypoint.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/debian/bin/docker-entrypoint.sh b/debian/bin/docker-entrypoint.sh index 204b623..98eefbe 100755 --- a/debian/bin/docker-entrypoint.sh +++ b/debian/bin/docker-entrypoint.sh @@ -91,10 +91,21 @@ get_subscription_file() { check_subscription() { if get_subscription_file; then - su -c "/usr/share/php/passbolt/bin/cake passbolt subscription_import $SUBSCRIPTION_FILE" -s /bin/bash www-data + echo "Subscription file found: $SUBSCRIPTION_FILE" + su -c "/usr/share/php/passbolt/bin/cake passbolt subscription_import --file $SUBSCRIPTION_FILE" -s /bin/bash www-data fi } +install_command() { + echo "Installing passbolt" + su -c '/usr/share/php/passbolt/bin/cake passbolt install --no-admin' -s /bin/bash www-data +} + +migrate_command() { + echo "Running migrations" + su -c '/usr/share/php/passbolt/bin/cake passbolt migrate' -s /bin/bash www-data +} + install() { if [ ! -f "$passbolt_config/app.php" ]; then su -c "cp $passbolt_config/app.default.php $passbolt_config/app.php" -s /bin/bash www-data @@ -105,9 +116,9 @@ install() { export PASSBOLT_GPG_SERVER_KEY_FINGERPRINT=$gpg_auto_fingerprint fi - check_subscription + check_subscription || true - su -c '/usr/share/php/passbolt/bin/cake passbolt install --no-admin' -s /bin/bash www-data || su -c '/usr/share/php/passbolt/bin/cake passbolt migrate' -s /bin/bash www-data && echo "Enjoy! ☮" + install_command || migrate_command && echo "Enjoy! ☮" } create_deprecation_message() {