File tree Expand file tree Collapse file tree 1 file changed +22
-9
lines changed
Expand file tree Collapse file tree 1 file changed +22
-9
lines changed Original file line number Diff line number Diff line change @@ -40,15 +40,6 @@ if [ -f "${WP_ROOT_FOLDER}/wp-config.php" ]; then
4040 rm -f " ${WP_ROOT_FOLDER} /wp-config.php"
4141fi
4242
43- echo " Using alternative database export method for WordPress 6.8+"
44- # Create a basic MySQL client config that forces no SSL
45- echo " [client]
46- ssl=false
47- [mysql]
48- ssl=false
49- [mysqldump]
50- ssl=false" > /tmp/.my.cnf
51-
5243echo " Creating wp-config.php..."
5344wp config create \
5445 --path=" ${WP_ROOT_FOLDER} " \
@@ -61,7 +52,29 @@ wp config create \
6152 --quiet \
6253 --allow-root
6354
55+ # Install WP if not yet installed
56+ if ! $( wp core is-installed --allow-root ) ; then
57+ echo " Installing WordPress..."
58+ wp core install \
59+ --path=" ${WP_ROOT_FOLDER} " \
60+ --url=" ${WORDPRESS_URL} " \
61+ --title=' Test' \
62+ --admin_user=" ${ADMIN_USERNAME} " \
63+ --admin_password=" ${ADMIN_PASSWORD} " \
64+ --admin_email=" ${ADMIN_EMAIL} " \
65+ --allow-root
66+ fi
6467
68+ # Use alternative database export for WordPress 6.8+ to avoid MariaDB SSL issues
69+ if [[ " ${WP_VERSION} " == " 6.8" * ]]; then
70+ echo " Using alternative database export method for WordPress 6.8+"
71+ # Create a basic MySQL client config that forces no SSL
72+ echo " [client]
73+ ssl=false
74+ [mysql]
75+ ssl=false
76+ [mysqldump]
77+ ssl=false" > /tmp/.my.cnf
6578
6679 # Export using mysqldump directly with SSL disabled
6780 MYSQL_PWD=${WORDPRESS_DB_PASSWORD} mysqldump \
You can’t perform that action at this time.
0 commit comments