Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
executable file 68 lines (41 sloc) 1.78 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 -R www-data:www-data wp-content
chmod 755 wp-content
export WP_CLI_CACHE_DIR=/wp-core/.wp-cli/cache
# 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
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
wp-su gf install gravityformscoupons --key=${GF_KEY} --activate --force --quiet
echo "Gravity Forms Coupons installation complete"
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
rm -rf /wp-core/wp-content/plugins/gravityformscoupons
echo "Grabbing the latest development master of Gravity Forms Coupons Add-On"
git clone -b master --single-branch https://$ /wp-core/wp-content/plugins/gravityformscoupons
cd /project
exec "/repo/vendor/bin/codecept" "$@"