Skip to content

Commit

Permalink
Merge pull request #8 from bigbite/dev
Browse files Browse the repository at this point in the history
0.1.4 Fix failing WordPress install
  • Loading branch information
Liam Defty authored Apr 8, 2020
2 parents 49df0ba + fc301e8 commit 7ab2335
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
21 changes: 11 additions & 10 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/bash
set -eu

if [ -f wp-config.php ]; then
rm wp-config.php
fi

: ${WP_LOCALE:=${WP_LOCALE:-en_US}}
: ${WP_ADMIN_EMAIL:=${WP_ADMIN_EMAIL:-admin@example.com}}

: ${WP_DB_HOST:=db}
: ${WP_DB_USER:=${MYSQL_ENV_MYSQL_USER:-root}}
: ${WP_DB_PASSWORD:=''}
Expand All @@ -17,6 +15,17 @@ wp core --allow-root download \
--version=${WP_VERSION} \
--force --debug

c=1
until mysqladmin ping -h"$WP_DB_HOST" --silent &> /dev/null
do
c=$((c + 1))
if [ $c -eq 60 ]
then
break
fi
sleep 2
done

# Generate the wp-config file for debugging.
wp core --allow-root config \
--dbhost="$WP_DB_HOST" \
Expand Down Expand Up @@ -46,12 +55,6 @@ EOF

chown "www-data:www-data" .htaccess

until mysqladmin ping -h"$WP_DB_HOST" --silent &> /dev/null
do
((c++)) && ((c==30)) && break
sleep 2
done

# Create the database.
wp db --allow-root create

Expand All @@ -62,6 +65,4 @@ wp --allow-root core install \
--admin_password=password \
--admin_email="[email protected]" \
--skip-email \

exec "$@"

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bigbite/wp-cypress",
"version": "0.1.3",
"version": "0.1.4",
"description": "WordPress end to end testing with Cypress.io",
"main": "lib/index.js",
"repository": "https://github.com/bigbite/wp-cypress",
Expand All @@ -11,7 +11,7 @@
},
"license": "MIT",
"publishConfig": {
"access": "public"
"access": "private"
},
"bin": {
"wp-cypress": "./bin/script.sh"
Expand Down

0 comments on commit 7ab2335

Please sign in to comment.