diff --git a/nextcloud/lib/common b/nextcloud/lib/common index 334b7dd..6b10366 100644 --- a/nextcloud/lib/common +++ b/nextcloud/lib/common @@ -93,9 +93,16 @@ create_occ_if_not_exists() { ## NEXTCLOUD_ADMIN_{USER,PASSWORD} that is required to trigger ## a full installation - export COMPOSE_IGNORE_ORPHANS=true - compose --debug --without-relation="$SERVICE_NAME":web-proxy run \ - --rm --entrypoint /entrypoint.sh "$SERVICE_NAME" apache >&2 || true + if ! out=$( + export COMPOSE_IGNORE_ORPHANS=true + compose --debug --without-relation="$SERVICE_NAME":web-proxy run \ + -v "$CHARM_PATH"/src/fake-apache:/usr/bin/apache \ + --rm --entrypoint /entrypoint.sh "$SERVICE_NAME" apache 2>&1 + ); then + err "Initialization of code or database failed unexpectedly" + e "$out" | prefix " | " + return 1 + fi if ! [ -e "$SERVICE_DATASTORE/var/www/html/occ" ]; then err "Expected last command to create /var/www/html/occ" return 1 diff --git a/nextcloud/src/fake-apache b/nextcloud/src/fake-apache new file mode 100755 index 0000000..3395065 --- /dev/null +++ b/nextcloud/src/fake-apache @@ -0,0 +1,3 @@ +#!/bin/bash + +true