forked from monksbistro/gravityflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-entrypoint.sh
executable file
·71 lines (43 loc) · 1.98 KB
/
docker-entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash
# 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
done
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 [email protected]
# 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
fi
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"
else
rm -rf /wp-core/wp-content/plugins/gravityforms
echo "Grabbing the latest development master of Gravity Forms"
git clone -b master --single-branch https://[email protected]/gravityforms/gravityforms.git /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://[email protected]/gravityforms/gravityformscoupons.git /wp-core/wp-content/plugins/gravityformscoupons
fi
cd /project
exec "/repo/vendor/bin/codecept" "$@"