Skip to content

Instantly share code, notes, and snippets.

@matt-bernhardt
Last active October 22, 2019 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matt-bernhardt/d6287b4ed11c42e4431c6d6b64e349d1 to your computer and use it in GitHub Desktop.
Save matt-bernhardt/d6287b4ed11c42e4431c6d6b64e349d1 to your computer and use it in GitHub Desktop.
This has been migrated to https://github.com/MITLibraries/vvv-custom

This content has been migrated to https://github.com/MITLibraries/vvv-custom

This should allow you to get a rudimentary copy of the MIT Libraries' WordPress network running under your VVV box.

Defining the network

  1. Clone https://github.com/Varying-Vagrant-Vagrants/VVV **Do not run vagrant up yet

  2. Clone vvv-custom.yml into the vagrant root from this repository (as a sibling to vvv-config.yml)

  3. Vagrant up Note any errors you encounter.

At this point you should have a running WordPress network visible at http://mitlib-public.test (at this point you will see a stock theme's homepage) You should also see the VVV dashboard at http://vvv.test/, which will list any other sites that have been defined.

Installing the parent theme

  1. Install and build the parent theme

    • Clone git@github.com:MITLibraries/MITlibraries-parent.git into $vagrantroot/www/mitlib-public/public_html/wp-content/themes/libraries (note the directory name must be libraries)
    • npm install to install the build tooling
    • grunt to run the build
  2. Log into WordPress at http://mitlib-public.test/wp-admin/ with the username admin and password

  3. Network-enable the parent theme at http://mitlib-public.test/wp-admin/network/themes.php

  4. Activate the parent theme to at http://mitlib-public.test/wp-admin/themes.php

  5. The theme should now be installed and ready to serve content. The front page will be broken for a bit longer, unfortunately, but the following URLs should work:

Further content can be found from the WP admin dashboard at http://mitlib-public.test/wp-admin/edit.php?post_type=page

Additional work

Other themes and plugins that we have developed can be cloned from GitHub into the relevant directories. Plugins go in $vagrantroot/www/mitlib-public/public_html/wp-content/plugins/ while themes go in ``$vagrantroot/www/mitlib-public/public_html/wp-content/themes/`. Themes will generally need a build step (item 4 above), while plugins will not.

Future work

This workflow is obviously painful. I'm working on making it suck less. The general roadmap includes:

  • Making the themes directory-agnositc
  • Making the themes auto-build (or not need a build step)
  • Building the entire network via Composer
  • Installing locally-built themes and plugins via the site template
  • Recovering a handful of plugins that are no longer listed in the WordPress directory (see the "missing_plugins" section above)
  • Probably a ton of other things that I'm just too used to getting around.
---
# This file is a YAML formatted file. YAML indenting is done in spaces not
# tabs, and whitespace is significant. If you don't stick to this, it will
# fail on provision
#
# IMPORTANT, if you change this file, you have to reprovision, no exceptions
# Do this by running either this command:
# vagrant reload --provision
#
# Or, if your machine is already turned on:
# vagrant provision
#
# These are your websites, and their names map on to the folders they're
# located in. See the docs for how to define these, and what all the keys
# and options are
sites:
mitlib-public:
skip_provisioning: false
description: "A version of the MIT Libraries' public website"
repo: https://github.com/MITLibraries/vvv-network-template
custom:
db_name: mitwordpress
missing_plugins:
- acf-location-field-master
- advanced-custom-fields-pro
- advanced-post-types-order
- custom-meta-box-template
- dynamic-menu-manager
- embedit-pro
- lightbox-2
- lightbox-plus
- my-category-order
- slidepress
- slug-trimmer
- types
mit_plugins:
- Custom-Child-Theme-Post-Types
- mitlib-analytics
- mitlib-cf7-elements
- mitlib-plugin-canary
- mitlib-private-debug-log
- mitlib-pull-hours
- pull-mit-events
- slideshow-gallery
- wp-home-page-news
- wp-pending-posts
install_plugins:
- acf-image-crop-add-on
- add-category-to-pages
- addthis
- akismet
- antivirus
- black-studio-tinymce-widget
- category-template-hierarchy
- cf7-conditional-fields
- cf7-to-zapier
- classic-editor
- cms-tree-page-view
- contact-form-7
- cpt-onomies
- custom-post-type-ui
- custom-sidebars
- google-sitemap-generator
- gutenberg
- img-title-removal
- improved-include-page
- insert-html-snippet
- jetpack
- media-library-assistant
- notification
- p3-profiler
- page-links-to
- post-snippets
- redirection
- seamless-sticky-custom-post-types
- tablepress
- tinymce-advanced
- ultimate-posts-widget
- unfiltered-mu
- w3-total-cache
- widget-context
- widget-css-classes
- widget-importer-exporter
- wordpress-importer
- wpcf7-recaptcha
- wp-security-audit-log
- wp-sentry-integration
- wp-table-reloaded
install_test_content: false
install_themes:
- twentytwelve
live_url: https://libraries.mit.edu
site_title: MIT Libraries development site
wp_type: subdirectory
wpconfig_constants:
WP_DEBUG: true
WP_DEBUG_LOG: true
hosts:
- mitlib-public.test
# The following commented out site configuration will create a standard WordPress
# site in www/example-site/ available at http://mysite.test.
# Remember, whitespace is significant! Tabs and spaces mean different things
#mysite:
# description: "My website"
# repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
# hosts:
# - mysite.test
# The wordpress-develop configuration is useful for contributing to WordPress Core.
# It uses the built WP to serve the site
wordpress-trunk:
skip_provisioning: true # provisioning this one takes longer, so it's disabled by default
description: "An svn based WP Core trunk dev setup, useful for contributor days, Trac tickets, patches"
repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template-develop.git
hosts:
- trunk.wordpress.test
# The following commented out site configuration will create a environment useful
# for contributions to the WordPress meta team, .e.g WordCamps, .org, etc:
wordpress-meta-environment:
skip_provisioning: true # disabled by default, this takes a long time to provision
repo: https://github.com/WordPress/meta-environment.git
# The following commented out site configuration will create a standard WordPress
# site in www/example-site/ available at http://my-example-site.test.
# Remember, whitespace is significant! Tabs and spaces mean different things
#example-site:
# repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
# hosts:
# - my-example-site.test
# Utilities https://varyingvagrantvagrants.org/docs/en-US/utilities/
# are system level items that aren't websites, that install tools or packages
# the core utilities install tools such as phpmyadmin
utilities:
core: # The core VVV utility
- tls-ca # HTTPS SSL/TLS certificates
- phpmyadmin # Web based database client
#- memcached-admin # Object cache management
#- opcache-status # opcache management
#- webgrind # PHP Debugging
#- mongodb # needed for Tideways/XHGui
#- tideways # PHP profiling tool, also installs xhgui check https://varyingvagrantvagrants.org/docs/en-US/references/tideways-xhgui/
#- php56
#- php70
#- php71
#- php72
#- php73
# vm_config controls how Vagrant provisions the virtual machine, and can be used to
# increase the memory given to VVV and the number of CPU cores.
# It can also be used to override the default provider being used within Vagrant.
vm_config:
# For WP core development we recommend at least 2GB ( 2048 ),
# If you have 4GB of RAM, lower this to 768MB or you may encounter issues
memory: 2048
# CPU cores:
cores: 2
# this tells VVV to use the prebuilt box copied from the USB drive at contributor days
# once set to false, do not change back to true, and reprovision
# wordcamp_contributor_day_box: false
# Due to a limitation within Vagrant, the specified provider is only respected on a clean `vagrant up`
# as Vagrant currently restricts you to one provider per machine
# https://www.vagrantup.com/docs/providers/basic_usage.html#vagrant-up
# provider: vmware_workstation
# General VVV options
general:
# Backup the databases to the database/backups subfolder on halt/suspend/destroy, set to false to disable
db_backup: true
# Import the databases if they're missing from backups
db_restore: true
# set to true to use a synced shared folder for MariaDB database storage
db_share_type: false
# GitHub token to use from composer
#github_token: xxxxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment