Permalink
Browse files

Merge pull request Varying-Vagrant-Vagrants#7 from Varying-Vagrant-Va…

…grants/simplify_hosts

Simplify hosts
  • Loading branch information...
tomjn committed Oct 23, 2018
2 parents fd7b8e2 + 1754f00 commit d17d70871a11a7ea246da341b927172d12db0d88
Showing with 23 additions and 7 deletions.
  1. +8 −3 README.md
  2. +8 −2 provision/vvv-init.sh
  3. +7 −2 provision/vvv-nginx.conf.tmpl
@@ -1,10 +1,15 @@
# VVV Custom site template (develop)
For when you just need a dev site running wordpress develop
# VVV Custom site template (WP Core develop)

For when you just need a dev site running wordpress develop. Great for contributor days, Trac tickets, etc

For general WP work such as theme building or plugin development, use the normal site template instead

## Overview
This template will allow you to create a WordPress dev environment running wordpress develop using only `vvv-custom.yml`.

This template will allow you to create a WordPress core dev environment running wordpress trunk using only `vvv-custom.yml`.

The supported environments are:

- A single site
- A subdomain multisite
- A subdirectory multisite
@@ -1,7 +1,6 @@
#!/usr/bin/env bash

DOMAIN=`get_primary_host "${VVV_SITE_NAME}".test`
DOMAINS=`get_hosts "${DOMAIN}"`
SITE_TITLE=`get_config_value 'site_title' "${DOMAIN}"`
WP_TYPE=`get_config_value 'wp_type' "single"`
DB_NAME=`get_config_value 'db_name' "${VVV_SITE_NAME}"`
@@ -76,4 +75,11 @@ fi
noroot mkdir -p "${VVV_PATH_TO_SITE}/public_html/src/wp-content/mu-plugins" "${VVV_PATH_TO_SITE}/public_html/build/wp-content/mu-plugins"

cp -f "${VVV_PATH_TO_SITE}/provision/vvv-nginx.conf.tmpl" "${VVV_PATH_TO_SITE}/provision/vvv-nginx.conf"
sed -i "s#{{DOMAINS_HERE}}#${DOMAINS}#" "${VVV_PATH_TO_SITE}/provision/vvv-nginx.conf"

if [ -n "$(type -t is_utility_installed)" ] && [ "$(type -t is_utility_installed)" = function ] && `is_utility_installed core tls-ca`; then
sed -i "s#{{TLS_CERT}}#ssl_certificate /vagrant/certificates/${VVV_SITE_NAME}/dev.crt;#" "${VVV_PATH_TO_SITE}/provision/vvv-nginx.conf"
sed -i "s#{{TLS_KEY}}#ssl_certificate_key /vagrant/certificates/${VVV_SITE_NAME}/dev.key;#" "${VVV_PATH_TO_SITE}/provision/vvv-nginx.conf"
else
sed -i "s#{{TLS_CERT}}##" "${VVV_PATH_TO_SITE}/provision/vvv-nginx.conf"
sed -i "s#{{TLS_KEY}}##" "${VVV_PATH_TO_SITE}/provision/vvv-nginx.conf"
fi
@@ -1,14 +1,19 @@
server {

listen 80;
listen 443 ssl;
server_name {{DOMAINS_HERE}};
server_name {vvv_hosts};
root {vvv_path_to_site}/public_html/build;

# Nginx logs
error_log {vvv_path_to_site}/log/error.log;
access_log {vvv_path_to_site}/log/access.log;

# This is needed to set the PHP being used
set $upstream {upstream};

{{TLS_CERT}}
{{TLS_KEY}}

# Nginx rules for WordPress, rewrite rules, permalinks, etc
include /etc/nginx/nginx-wp-common.conf;
}

0 comments on commit d17d708

Please sign in to comment.