more debugs messages on wp installation

This commit is contained in:
asus
2023-09-03 17:37:23 +02:00
parent 80aa4b7f4a
commit a1532e1873
4 changed files with 17 additions and 18 deletions

View File

@@ -39,7 +39,7 @@ COPY ./conf/ssl ${NG_VOLUME_CERTS}
RUN if [ -z "$(ls -A ${NG_VOLUME_CERTS} 2>/dev/null)" ]; then \
mkdir ${NG_VOLUME_CERTS}/private ${NG_VOLUME_CERTS}/certs; \
openssl req -newkey rsa:2048 -nodes -x509 -days 365 \
-subj "/C=fr/ST=ile-de-france/L=paris/O=42/OU=lejourdesprofs/CN=${WP_URL}" \
-subj "/C=fr/ST=ile-de-france/L=paris/O=ljdp/OU=lejourdesprofs/CN=${WP_URL}" \
-keyout ${NG_VOLUME_CERTS}/private/${WP_URL}.key \
-out ${NG_VOLUME_CERTS}/certs/${WP_URL}.crt; \
fi

View File

@@ -16,6 +16,7 @@ RESET="\e[0m"
echo -e ${YELLOW}download wordpress :${RESET}
if ! wp core version --path="${WP_VOLUME_DIR}" 2> /dev/null
then
echo -e ${YELLOW}-> wordpress version${RESET}
mkdir -p ${WP_VOLUME_DIR}
wp core download --path="${WP_VOLUME_DIR}" --allow-root
else
@@ -76,12 +77,15 @@ fi
if ! wp core is-installed --path="${WP_VOLUME_DIR}" 2> /dev/null
then
echo -e ${YELLOW}installing...${RESET}
echo -e ${YELLOW}wp config create...${RESET}
wp config create \
--dbhost="${DB_HOST}" \
--dbname="${DB_NAME}" \
--dbuser="${DB_USER}" \
--dbpass="${DB_PSWD}" \
--path="${WP_VOLUME_DIR}" --allow-root
echo -e ${YELLOW}wp core install...${RESET}
wp core install \
--url="${WP_URL}" \
--title="${WP_TITLE}" \
@@ -90,18 +94,24 @@ then
--admin_password="${WP_ADMIN_PSWD}" \
--skip-email \
--path="${WP_VOLUME_DIR}" --allow-root
echo -e ${YELLOW}wp user create...${RESET}
wp user create \
"${WP_USER}" "${WP_USER_EMAIL}" \
--user_pass="${WP_USER_PSWD}" \
--path="${WP_VOLUME_DIR}" --allow-root
echo -e ${YELLOW}chown and chmod...${RESET}
chown -R www-data:www-data /var/www/*
chmod 755 -R /var/www/*
echo -e ${YELLOW}plugins...${RESET}
plugins=$(ls ${WP_VOLUME_PLUGINS})
for dir in $plugins; do
ln -s ${WP_VOLUME_PLUGINS}/$dir ${WP_VOLUME_DIR}/wp-content/plugins/$dir
done
echo -e ${GREEN}done !${RESET}
else
echo -e ${GREEN}wp is installed${RESET}
fi