Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 61 lines (37 sloc) 1.5 KB
# Allows WP CLI to run with the right permissions.
wp-su() {
sudo -E -u www-data wp "$@"
# Clean up from previous tests
rm -rf /wp-core/wp-content/uploads/gravity_forms
# Make sure permissions are correct.
cd /wp-core
chown www-data:www-data wp-content
chmod 755 wp-content
# Make sure the database is up and running.
while ! mysqladmin ping -hmysql --silent; do
echo 'Waiting for the database'
sleep 1
echo 'The database is ready'
# Make sure WordPress is installed.
if ! $(wp-su core is-installed); then
echo "Installing WordPress"
wp-su core install --url=wordpress --title=tests --admin_user=admin
# The development version of Gravity Flow requires SCRIPT_DEBUG
wp-su core config --dbhost=mysql --dbname=wordpress --dbuser=root --dbpass=wordpress --extra-php="define( 'SCRIPT_DEBUG', true );" --force
if [ -z ${GITHUB_TOKEN} ]; then
echo "Installing the latest version of Gravity Forms using the CLI"
wp-su plugin install gravityformscli --force --activate
wp-su gf install --key=${GF_KEY} --activate --force --quiet
echo "Gravity Forms installation complete"
wp-su gf tool verify-checksums
rm -rf /wp-core/wp-content/plugins/gravityforms
echo "Grabbing the latest development master of Gravity Forms"
git clone -b master --single-branch https://$ /wp-core/wp-content/plugins/gravityforms
cd /project
exec "/repo/vendor/bin/codecept" "$@"