mirror of
https://github.com/nextcloud/docker.git
synced 2024-11-05 22:04:58 +01:00
fix(entrypoint): Delay on auto-install to avoid error before retry
Signed-off-by: Josh Richards <josh.t.richards@gmail.com>
This commit is contained in:
parent
7a4823180d
commit
50cefd5557
10 changed files with 80 additions and 30 deletions
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
|
@ -202,6 +202,7 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
file_env POSTGRES_USER
|
||||
|
||||
install=false
|
||||
db_wait='1s'
|
||||
if [ -n "${SQLITE_DATABASE+x}" ]; then
|
||||
echo "Installing with SQLite database"
|
||||
# shellcheck disable=SC2016
|
||||
|
@ -212,27 +213,31 @@ if expr "$1" : "apache" 1>/dev/null || [ "$1" = "php-fpm" ] || [ "${NEXTCLOUD_UP
|
|||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database mysql --database-name "$MYSQL_DATABASE" --database-user "$MYSQL_USER" --database-pass "$MYSQL_PASSWORD" --database-host "$MYSQL_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
elif [ -n "${POSTGRES_DB+x}" ] && [ -n "${POSTGRES_USER+x}" ] && [ -n "${POSTGRES_PASSWORD+x}" ] && [ -n "${POSTGRES_HOST+x}" ]; then
|
||||
echo "Installing with PostgreSQL database"
|
||||
# shellcheck disable=SC2016
|
||||
install_options=$install_options' --database pgsql --database-name "$POSTGRES_DB" --database-user "$POSTGRES_USER" --database-pass "$POSTGRES_PASSWORD" --database-host "$POSTGRES_HOST"'
|
||||
install=true
|
||||
db_wait='10s'
|
||||
fi
|
||||
|
||||
if [ "$install" = true ]; then
|
||||
run_path pre-installation
|
||||
|
||||
echo "Starting nextcloud installation"
|
||||
echo "Starting Nextcloud installation"
|
||||
max_retries=10
|
||||
try=0
|
||||
echo "Waiting ($db_wait) for initialization of database to complete (NOTE: if this fails the first time we'll retry again in 10s)..."
|
||||
sleep $db_wait
|
||||
until run_as "php /var/www/html/occ maintenance:install $install_options" || [ "$try" -gt "$max_retries" ]
|
||||
do
|
||||
echo "Retrying install..."
|
||||
echo "Retrying installation..."
|
||||
try=$((try+1))
|
||||
sleep 10s
|
||||
done
|
||||
if [ "$try" -gt "$max_retries" ]; then
|
||||
echo "Installing of nextcloud failed!"
|
||||
echo "Installation of Nextcloud failed!"
|
||||
exit 1
|
||||
fi
|
||||
if [ -n "${NEXTCLOUD_TRUSTED_DOMAINS+x}" ]; then
|
||||
|
|
Loading…
Reference in a new issue