WordPress / meta-environment

A collection of scripts that provision the official WordPress.org websites into a Varying Vagrant Vagrants installation.
190 stars 69 forks source link

Allow selective installation of sites #87

Closed LoreleiAurora closed 7 years ago

LoreleiAurora commented 7 years ago

As custom options can be used in VVV2 we should allow disabling of individual sites, so you only install what you need. This would allow for a config like the following:

wordpress-meta-environment:
  repo: https://github.com/WordPress/meta-environment.git
  custom:
    provision_site:
      "buddypressorg.dev": false
      "jobs.wordpressnet.dev": false
ocean90 commented 7 years ago

@LoreleiAurora Is it just an update to the config or do we have to change something in the provisioning scripts too?

LoreleiAurora commented 7 years ago

@ocean90 Sorry i didn't notice this question until now :)

This would require a slight modification to the config, but i have figured out how to do this without breaking bc.

This could be achieved with a function like this in helper-functions.sh

function wme_provision_site {
    WME_SITE_ESCAPED=`echo ${1} | sed 's/\./\\\\./g'`
    WME_PROVISION_SITE=`get_config_value "provision_site.${WME_SITE_ESCAPED}" 'true'`
    echo ${WME_PROVISION_SITE,,}
}

and a call to this function at the top of each vvv-init.sh file

if [[ `wme_provision_site 'buddypressorg.dev'` == 'false' ]]; then
    echo "buddypressorg.dev skipped"
    return
fi