Fixed the non-interactive install
This commit is contained in:
parent
0d2a782d14
commit
2ff26f561a
@ -23,57 +23,23 @@ source .env
|
|||||||
set +o allexport
|
set +o allexport
|
||||||
|
|
||||||
##################################################################
|
##################################################################
|
||||||
# create json file
|
# non interactive install
|
||||||
|
#
|
||||||
|
# https://docs.joomla.org/J4.x:Joomla_CLI_Installation
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
#DB_PREFIX=$(echo $RANDOM | md5sum | awk '{print substr($1, 1, 3)}')_
|
DB_PREFIX=$(LC_CTYPE=C tr -dc '[:alpha:]' < /dev/urandom | head -c 3)_
|
||||||
|
|
||||||
# docker-compose exec -u www-data joomla sh -c "echo '{
|
|
||||||
# \"language\":\"en-GB\",
|
|
||||||
# \"site_name\":\"$PROJECTNAME\",
|
|
||||||
# \"admin_email\":\"$EMAIL\",
|
|
||||||
# \"admin_user\":\"$JOOMLA_USER\",
|
|
||||||
# \"admin_password\":\"$JOOMLA_PASSWORD\",
|
|
||||||
# \"db_type\":\"mysql\",
|
|
||||||
# \"db_host\":\"mariadb\",
|
|
||||||
# \"db_user\":\"$MYSQL_USER\",
|
|
||||||
# \"db_pass\":\"$MYSQL_PASSWORD\",
|
|
||||||
# \"db_name\":\"$MYSQL_DATABASE\",
|
|
||||||
# \"db_prefix\":\"$DB_PREFIX\",
|
|
||||||
# \"db_old\":\"remove\",
|
|
||||||
# \"helpurl\":\"https://joomla.org\"
|
|
||||||
# }' > config.json"
|
|
||||||
|
|
||||||
# docker-compose exec -u www-data joomla php cli/joomla.php core:install --file=config.json
|
|
||||||
|
|
||||||
##################################################################
|
|
||||||
# EASY GUI SETUP
|
|
||||||
##################################################################
|
|
||||||
|
|
||||||
# Site Name
|
|
||||||
xmlstarlet ed -L -s '//field[@name="site_name"]' -t attr -n default -v "$PROJECTNAME" html/installation/forms/setup.xml
|
|
||||||
|
|
||||||
# Super User Full Name
|
|
||||||
xmlstarlet ed -L -s '//field[@name="admin_user"]' -t attr -n default -v "$JOOMLA_USER" html/installation/forms/setup.xml
|
|
||||||
|
|
||||||
# Super User username
|
|
||||||
xmlstarlet ed -L -s '//field[@name="admin_username"]' -t attr -n default -v "$JOOMLA_USER" html/installation/forms/setup.xml
|
|
||||||
|
|
||||||
# Super User Password
|
|
||||||
xmlstarlet ed -L -s '//field[@name="admin_password"]' -t attr -n default -v "$JOOMLA_PASSWORD" html/installation/forms/setup.xml
|
|
||||||
|
|
||||||
# Super User email
|
|
||||||
xmlstarlet ed -L -s '//field[@name="admin_email"]' -t attr -n default -v "$EMAIL" html/installation/forms/setup.xml
|
|
||||||
|
|
||||||
# Database host
|
|
||||||
xmlstarlet ed -L -u '//field[@name="db_host"]/@default' -v 'mariadb' html/installation/forms/setup.xml
|
|
||||||
|
|
||||||
# Database user
|
|
||||||
xmlstarlet ed -L -s '//field[@name="db_user"]' -t attr -n default -v "$MYSQL_USER" html/installation/forms/setup.xml
|
|
||||||
|
|
||||||
# Database password
|
|
||||||
xmlstarlet ed -L -s '//field[@name="db_pass"]' -t attr -n default -v "$MYSQL_PASSWORD" html/installation/forms/setup.xml
|
|
||||||
|
|
||||||
# Database name
|
|
||||||
xmlstarlet ed -L -u '//field[@name="db_name"]/@default' -v "$MYSQL_DATABASE" html/installation/forms/setup.xml
|
|
||||||
|
|
||||||
|
docker-compose exec -u www-data joomla php installation/joomla.php install \
|
||||||
|
--site-name=$PROJECTNAME \
|
||||||
|
--admin-email=$EMAIL \
|
||||||
|
--admin-user=$JOOMLA_USER \
|
||||||
|
--admin-username=$JOOMLA_USER \
|
||||||
|
--admin-password=$JOOMLA_PASSWORD \
|
||||||
|
--db-type=mysqli \
|
||||||
|
--db-host=mariadb \
|
||||||
|
--db-user=$MYSQL_USER \
|
||||||
|
--db-pass=$MYSQL_PASSWORD \
|
||||||
|
--db-name=$MYSQL_DATABASE \
|
||||||
|
--db-prefix=$DB_PREFIX \
|
||||||
|
--db-encryption=0
|
||||||
|
Reference in New Issue
Block a user