diff --git a/tests/e2e/env/docker/wp-cli/entrypoint.sh b/tests/e2e/env/docker/wp-cli/entrypoint.sh index e077780cb89b4..80333975ac174 100644 --- a/tests/e2e/env/docker/wp-cli/entrypoint.sh +++ b/tests/e2e/env/docker/wp-cli/entrypoint.sh @@ -33,6 +33,7 @@ if $(wp core is-installed); then echo "Wordpress is already installed..." else + WORDPRESS_INSTALLING=1 declare -p WORDPRESS_TITLE >/dev/null declare -p WORDPRESS_LOGIN >/dev/null declare -p WORDPRESS_PASSWORD >/dev/null @@ -45,11 +46,6 @@ else --admin_password=${WORDPRESS_PASSWORD} \ --admin_email=${WORDPRESS_EMAIL} \ --skip-email - wp post create \ - --post_type=page \ - --post_status=publish \ - --post_title='Ready' \ - --post_content='E2E-tests.' fi ## Check for an initialization script. @@ -66,5 +62,14 @@ if ! [[ ${CURRENT_DOMAIN} == ${URL} ]]; then wp search-replace ${CURRENT_DOMAIN} ${URL} fi +if [[ $WORDPRESS_INSTALLING ]]; +then + wp post create \ + --post_type=page \ + --post_status=publish \ + --post_title='Ready' \ + --post_content='E2E-tests.' +fi + echo "Visit $(wp option get siteurl)" touch /var/www/html/.initialized