This repository has been archived by the owner on Jun 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
vvv-init.sh
128 lines (103 loc) · 3.85 KB
/
vvv-init.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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
printf "\nCommencing Setup Theme Review\n"
# If we delete htdocs, let's just start over.
if [ ! -d htdocs ]
then
printf "Creating directory htdocs for Theme review...\n"
mkdir htdocs
cd htdocs
# **
# Database
# **
# Create the database over again.
printf "(Re-)Creating database 'wordpress_themereview'...\n"
mysql -u root --password=root -e "DROP DATABASE IF EXISTS \`wordpress_themereview\`"
mysql -u root --password=root -e "CREATE DATABASE IF NOT EXISTS \`wordpress_themereview\`"
mysql -u root --password=root -e "GRANT ALL PRIVILEGES ON \`wordpress_themereview\`.* TO wp@localhost IDENTIFIED BY 'wp';"
# **
# WordPress
# **
# Download WordPress
printf "Downloading WordPress in htdocs...\n"
wp core download --allow-root
# Install WordPress.
printf "Creating wp-config in htdocs...\n"
wp core config --dbname="wordpress_themereview" --dbuser=wp --dbpass=wp --dbhost="localhost" --allow-root --extra-php <<PHP
define( 'WP_DEBUG', true );
define( 'SCRIPT_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
PHP
# Install into DB
wp core install --url=themereview.wordpress.dev --title="A WordPress Theme Reviewers VVV" --admin_user=admin --admin_password=password --admin_email=changme@changeme.com --allow-root
# **
# Your themes
# **
printf 'Installing themes...\n'
for i in `ls ../*.zip`
do
wp theme install $i --allow-root
done
# **
# # Plugins
# **
printf 'Installing plugins...\n'
wp plugin install wordpress-importer --activate --allow-root
wp plugin install developer --activate --allow-root
wp plugin install theme-check --activate --allow-root
wp plugin install theme-mentor --activate --allow-root
wp plugin install theme-checklist --activate --allow-root
wp plugin install what-the-file --activate --allow-root
wp plugin install vip-scanner --activate --allow-root
wp plugin install wordpress-database-reset --activate --allow-root
wp plugin install rtl-tester --allow-root
wp plugin install piglatin --allow-root
wp plugin install debug-bar --activate --allow-root
wp plugin install debug-bar-console --activate --allow-root
wp plugin install debug-bar-cron --activate --allow-root
wp plugin install debug-bar-extender --activate --allow-root
wp plugin install rewrite-rules-inspector --activate --allow-root
wp plugin install log-deprecated-notices --activate --allow-root
wp plugin install log-deprecated-notices-extender --activate --allow-root
wp plugin install log-viewer --activate --allow-root
wp plugin install monster-widget --activate --allow-root
wp plugin install user-switching --activate --allow-root
wp plugin install regenerate-thumbnails --activate --allow-root
wp plugin install simply-show-ids --activate --allow-root
wp plugin install theme-test-drive --activate --allow-root
wp plugin install wordpress-beta-tester --activate --allow-root
# **
# Unit Data
# **
# Import the unit data.
printf 'Installing unit test data...\n'
curl -O https://wpcom-themes.svn.automattic.com/demo/theme-unit-test-data.xml
wp import theme-unit-test-data.xml --authors=create --allow-root
rm theme-unit-test-data.xml
# Replace url from unit data
printf 'Adjusting urls in database...\n'
wp search-replace 'wpthemetestdata.wordpress.com' 'themereview.wordpress.dev' --skip-columns=guid --allow-root
cd ..
else
cd htdocs/
# Updates
if $(wp core is-installed --allow-root); then
# Update WordPress.
printf "Updating WordPress for Theme Review...\n"
wp core update --allow-root
wp core update-db --allow-root
# Update Plugins
printf "Updating plugins for Theme Review...\n"
wp plugin update --all --allow-root
# Update preloaded Themes
printf "Updating preloaded themes for Theme Review...\n"
wp theme update --all --allow-root
# **
# Your themes
# **
printf "Installing themes for Theme Review...\n"
for i in `ls ../*.zip`
do
wp theme install $i --allow-root
done
fi
cd ..
fi