Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split provisioners into external git repos #980

Merged
merged 16 commits into from Nov 4, 2016
Merged

Split provisioners into external git repos #980

merged 16 commits into from Nov 4, 2016

Conversation

@LoreleiAurora
Copy link
Member

@LoreleiAurora LoreleiAurora commented Aug 23, 2016

Tasks:

  • YAML config file to control VVV (Fixes #313)
  • Allow selecting which sites to make active (Fixes #474)
  • Ability to provision sites individually (Fixes #753)
  • Split provisioning of WP sites (Fixes #611 #210)

  • Ability to include Customfile from any folder (Fixes #851)
  • Pass site name & root dir to vvv-init scripts
  • Pass site name & root dir to nginx config (Fixes #771)
  • Allow a site to be stored outside the VVV dir on the host machine

YAML config file to control VVV

The YAML config file will allow inclusion of external provisioning scripts from git repos and disabling of provisioning of specific sites (at a later date it can be used to configure other aspects of VVV).

To use a default option for any site parameter simply miss it out of the site block.

sites:
  # All options defaults that can be used in a site config
  wordpress-default:
    # The git url for this site
    # e.g. https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
    repo: ''
    # The directory on the vm where the site lives
    # e.g.  '/srv/www/wordpress-default'
    vm_dir: /srv/www/{SITE NAME}
    # The directory on the host where the site lives
    # e.g.  '/PATH TO VVV/www/wordpress-default'
    local_dir: vagrant_dir/www/{SITE NAME}
    # Weather to use the sites Customfile if one is found
    allow_customfile: false 
    # Weather to run this sites provisioner
    skip_provisioning: false

    # If you are only providing a repo url to your site config 
    multisite: https://github.com/Varying-Vagrant-Vagrants/vvv-multisite.git

    # Site not stored in git accepting the default options
    site_name:

Ability to provision sites individually

Sites can be provisioned individually using the following vagrant command
vagrant provision --provision-with site-{sitename}
e.g. vagrant provision --provision-with site-wordpress-default

New Variables

Bash Variable Nginx Variable Example
${VVV_PATH_TO_SITE} {vvv_path_to_site} /srv/www/wordpress-default
${VVV_SITE_NAME} {vvv_site_name} wordpress-default

Path to site uses the vm_dir as defined in the config as apposed to the path to the dir in which the nginx config or shell script was found. This resolves the issue listed in #771.

@jeremyfelt jeremyfelt added the feature label Aug 23, 2016
@LoreleiAurora LoreleiAurora changed the title [WIP] Split provisioners into external git repos Split provisioners into external git repos Aug 23, 2016
@mbijon
Copy link
Contributor

@mbijon mbijon commented Aug 24, 2016

This is excellent for granularity, resources, and general control-freak moments. All these changes get a +1 from me (I haven't tested yet, but several of these things are great ideas).

It's a huge batch of changes though. So I'll say something I always say when I like something and want to see it in prod... if there's any resistance please break it up and include whatever possible. Let's only delay pieces that are disputed or buggy, not everything g.

@jeremyfelt
Copy link
Member

@jeremyfelt jeremyfelt commented Aug 24, 2016

I haven't had time to dig in yet, but I want to leave a note of general support for this. I'll take a closer look over the next few days. Thank you @LoreleiAurora!

@cfoellmann
Copy link
Member

@cfoellmann cfoellmann commented Oct 12, 2016

how about changing the dashboard like so?

---
default:
  dashboard:
    repo: https://github.com/topdown/VVV-Dashboard.git
---
sites:
  wordpress-default:
    repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
    vm_dir: '/srv/www/wordpress-default-provisioner'
[...]
@cfoellmann
Copy link
Member

@cfoellmann cfoellmann commented Oct 12, 2016

@LoreleiAurora the timer for the provisioning is shown before the start of the provisioning of the sites. Not at the very end of the process

@LoreleiAurora
Copy link
Member Author

@LoreleiAurora LoreleiAurora commented Oct 12, 2016

@cfoellmann i forgot the timer existed, as each site is called as a separate vagrant provisioner i'm not really sure how we could keep it. Unless anyone else has any ideas?

@cfoellmann
Copy link
Member

@cfoellmann cfoellmann commented Oct 12, 2016

maybe add the counter to all provisioners? I can add them together. 😸

@LoreleiAurora
Copy link
Member Author

@LoreleiAurora LoreleiAurora commented Oct 12, 2016

@cfoellmann if you want to try that you can.
If you have you have push on this repo you also have push on LoreleiAurora:split-provisioners

@cfoellmann
Copy link
Member

@cfoellmann cfoellmann commented Oct 13, 2016

@jeremyfelt can you add some repos for multisite?

  • vvv-wpmu-subdirectory
  • vvv-wpmu-subdirectory-trunk
  • vvv-wpmu-subdomain
  • vvv-wpmu-subdomain-trunk
@Mte90
Copy link
Member

@Mte90 Mte90 commented Nov 4, 2016

There is a docs about that file? like the name of the file? what is the path? Also this works with old installation of vvv?
sorry for the many questions XD

@LoreleiAurora LoreleiAurora deleted the LoreleiAurora:split-provisioners branch Nov 4, 2016
@LoreleiAurora
Copy link
Member Author

@LoreleiAurora LoreleiAurora commented Nov 4, 2016

@Mte90 The file is vvv-config.yml in the root dir.
For this to work with your existing installation your config would look something like this:

sites:
  wordpress-default:
    repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
    vm_dir: '/srv/www/wordpress-default-provisioner'

  wordpress-develop:
    repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-develop.git
    vm_dir: '/srv/www/wordpress-develop-provisioner'

  // The below lines are the directory names of your site configs followed by a colon.
  preexisting-site-1: 
  preexisting-site-2:
  preexisting-site-3: 

I still need to write docs/migration guide.

@Mte90
Copy link
Member

@Mte90 Mte90 commented Nov 4, 2016

So in the case that I have many installed with vv this is compatible?
In case it's better that vv get the support for this before to use in my case

@LoreleiAurora
Copy link
Member Author

@LoreleiAurora LoreleiAurora commented Nov 4, 2016

I have not tested compatibility with vv, but if its not i would love to help make it compatible.
Ping @bradp

@LoreleiAurora
Copy link
Member Author

@LoreleiAurora LoreleiAurora commented Nov 4, 2016

@jeremyfelt Rather than having a repo for each of utilities what do you think about adding another key to the yaml file and storing them in one repo. This would give a config like this:

sites: 
  <Redacted for simplicity>

utilities:
  phpmyadmin: true
  memcached-admin: true
  opcache-status: true
  webgrind: true

Then any other utils (including third party ones) can be added to this repo and work with just one line. Kind of like a VVV plugin directory.

For example i have mongodb & adminmongo installed in vvv, this config could live as part of the utils repo.

@cfoellmann
Copy link
Member

@cfoellmann cfoellmann commented Nov 4, 2016

Shouldn't we look into provisioning the utilities via composer? I wanted to do it in the past but time...

@LoreleiAurora
Copy link
Member Author

@LoreleiAurora LoreleiAurora commented Nov 4, 2016

@cfoellmann we can do that in the scripts, but we keep the scripts that trigger the installs in that repo allowing non composer tools to be added with 1 uniform method of configuration.

@topdown
Copy link

@topdown topdown commented Nov 26, 2016

What about adding a Yaml linter to validate these YAML files?
https://github.com/adrienverge/yamllint

Would hopefully lower support issues/questions when this PR is rolled out.
Just a thought.

@LoreleiAurora
Copy link
Member Author

@LoreleiAurora LoreleiAurora commented Nov 26, 2016

@topdown can you please open that as a new issue as this is already in develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants