Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Commit fd6be0e

Browse files
author
Luis Rodrigues
committed
Initial commit
0 parents  commit fd6be0e

File tree

8 files changed

+182
-0
lines changed

8 files changed

+182
-0
lines changed

.gitignore

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
*.log
2+
3+
# Ignore WordPress files
4+
/wp-admin
5+
/wp-content
6+
/wp-includes
7+
/index.php
8+
/license.txt
9+
/readme.html
10+
/wp-activate.php
11+
/wp-blog-header.php
12+
/wp-comments-post.php
13+
/wp-config-sample.php
14+
/wp-config.php
15+
/wp-cron.php
16+
/wp-links-opml.php
17+
/wp-load.php
18+
/wp-login.php
19+
/wp-mail.php
20+
/wp-settings.php
21+
/wp-signup.php
22+
/wp-trackback.php
23+
/xmlrpc.php
24+
25+
# Do not ignore B3-related project files
26+
!/wp-content/themes/b3
27+
!/wp-content/plugins/b3-rest-api
28+
!/wp-content/plugins/json-rest-api

.gitmodules

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "wp-content/themes/b3"]
2+
path = wp-content/themes/b3
3+
url = [email protected]:B3ST/B3.git
4+
[submodule "wp-content/plugins/b3-rest-api"]
5+
path = wp-content/plugins/b3-rest-api
6+
url = [email protected]:B3ST/B3-REST-API.git
7+
[submodule "wp-content/plugins/json-rest-api"]
8+
path = wp-content/plugins/json-rest-api
9+
url = [email protected]:B3ST/WP-API.git

vvv-hosts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
b3.dev

vvv-init.sh

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
#!/bin/bash
2+
3+
## CONFIGURATION ##
4+
5+
TITLE="B3 Development"
6+
URL="b3.dev:8888"
7+
DATABASE="b3_dev"
8+
ADMIN_EMAIL="[email protected]"
9+
THEME="b3"
10+
11+
PLUGINS=(json-rest-api b3-rest-api)
12+
13+
## PROVISIONING ##
14+
15+
echo "Setting up a local ${TITLE} project..."
16+
17+
if ! $(wp core is-installed); then
18+
19+
echo " * Downloading WordPress"
20+
21+
wp core download
22+
23+
echo " * Creating database schema ${DATABASE}"
24+
25+
mysql -u root --password=root -e "CREATE DATABASE IF NOT EXISTS ${DATABASE}"
26+
mysql -u root --password=root -e "GRANT ALL PRIVILEGES ON ${DATABASE}.* TO wp@localhost IDENTIFIED BY 'wp';"
27+
28+
echo " * Configuring WordPress"
29+
30+
WP_CACHE_KEY_SALT=`date +%s | sha256sum | head -c 64`
31+
32+
wp core config --dbname="${DATABASE}" --dbuser=wp --dbpass=wp --extra-php <<PHP
33+
34+
define( 'WP_DEBUG', true );
35+
define( 'WP_DEBUG_LOG', true );
36+
define( 'WP_DEBUG_DISPLAY', false );
37+
@ini_set( 'display_errors', 0 );
38+
define( 'SAVEQUERIES', false );
39+
define( 'JETPACK_DEV_DEBUG', true );
40+
41+
define( 'WP_CACHE', true );
42+
define( 'WP_CACHE_KEY_SALT', '$WP_CACHE_KEY_SALT' );
43+
44+
\$redis_server = array( 'host' => '127.0.0.1', 'port' => 6379 );
45+
46+
define( 'WP_ENV', 'development' );
47+
PHP
48+
49+
wp core install --url="${URL}" --title="${TITLE}" --admin_user=admin --admin_password=password --admin_email=${ADMIN_EMAIL}
50+
51+
echo " * Configuring pretty permalinks"
52+
53+
wp option update permalink_structure "/%postname%/"
54+
55+
echo " * Importing test content"
56+
57+
curl -OLs https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml
58+
wp plugin install wordpress-importer
59+
wp plugin activate wordpress-importer
60+
wp import wptest.xml --authors=create
61+
rm wptest.xml
62+
63+
echo " * Installing and activating development plugins"
64+
65+
wp plugin install developer
66+
wp plugin activate --network developer
67+
68+
## OBJECT CACHE ##
69+
70+
echo " * Setting up object cache"
71+
72+
sudo apt-get -y install redis-server php5-redis
73+
sudo service php5-fpm restart
74+
75+
wp plugin install wp-redis
76+
wp plugin update wp-redis
77+
cp wp-content/plugins/wp-redis/object-cache.php wp-content/object-cache.php
78+
79+
touch wp-content/advanced-cache.php
80+
fi
81+
82+
## UPDATING COMPONENTS ##
83+
84+
echo " * Updating WordPress"
85+
86+
wp core update
87+
wp core update-db
88+
89+
git submodule update --init
90+
91+
## BUILDING COMPONENTS ##
92+
93+
echo " * Building the default theme"
94+
95+
cd "wp-content/themes/${THEME}"
96+
npm install -g gulp bower
97+
su vagrant -c "npm install"
98+
su vagrant -c "bower install"
99+
cd ../../..
100+
101+
## ACTIVATING COMPONENTS ##
102+
103+
echo " * Activating plugins"
104+
105+
wp plugin activate ${PLUGINS[*]}
106+
107+
echo " * Activating the default theme"
108+
109+
wp theme activate ${THEME}
110+
111+
echo "All done!"

vvv-nginx.conf

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
server {
2+
# Listen at port 80 for HTTP requests
3+
listen 80;
4+
listen 8888;
5+
# Listen at port 443 for secure HTTPS requests
6+
listen 443 ssl;
7+
# The domain name(s) that the site should answer
8+
# for. You can use a wildcard here, e.g.
9+
# *.example.com for a subdomain multisite.
10+
server_name b3.dev;
11+
12+
# The folder containing your site files.
13+
# The {vvv_path_to_folder} token gets replaced
14+
# with the folder containing this, e.g. if this
15+
# folder is /srv/www/foo/ and you have a root
16+
# value of `{vvv_path_to_folder}/htdocs` this
17+
# will be auto-magically transformed to
18+
# `/srv/www/foo/htdocs`.
19+
root {vvv_path_to_folder};
20+
21+
rewrite ^/sitemap_index\.xml$ /index.php?sitemap=1 last;
22+
rewrite ^/([^/]+?)-sitemap([0-9]+)?\.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
23+
24+
# A handy set of common Nginx configuration commands
25+
# for WordPress, maintained by the VVV project.
26+
include /etc/nginx/nginx-wp-common.conf;
27+
28+
# HHVM
29+
# include /etc/nginx/nginx-wp-subdirectory.conf;
30+
}

wp-content/plugins/b3-rest-api

Submodule b3-rest-api added at 779b40a

wp-content/plugins/json-rest-api

Submodule json-rest-api added at ad9688f

wp-content/themes/b3

Submodule b3 added at 607eab2

0 commit comments

Comments
 (0)