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

Allow selecting which sites to make active #474

Closed
tnorthcutt opened this issue Oct 13, 2014 · 21 comments
Closed

Allow selecting which sites to make active #474

tnorthcutt opened this issue Oct 13, 2014 · 21 comments

Comments

@tnorthcutt
Copy link
Contributor

I keep a number of sites (~20 right now) on one VVV install. Most of those, however, are only around for the rare instance when I need to work on them, and 90%+ of the time, I don't need them available. To speed up destroy, halt, up, provision, etc. it would be great to have a way to indicate which sites should be loaded at any given time. Perhaps a simple text file that provision.sh can look for, and if found, would then use to load only the sites explicitly defined?

I'm not sure if that's the best approach (and if it is, how exactly to implement that), but if given some direction, I'd be happy to submit a PR to implement this functionality.

@westonruter
Copy link
Contributor

Great idea.

Probably the best way to go about implementing this is to introduce a .gitignore'ed file which contains the paths to exclude when provision.sh does these find calls:

For that matter, the file could have the list of files paths to search instead of the ones to exclude. In other words, if the includes file does not exist, use /srv/www. If it does exist, use the paths inside the file in the find command.

@tnorthcutt
Copy link
Contributor Author

@westonruter thanks, that helps a lot. I'd lean toward having a list of paths to explicitly include, as opposed to exclude. Got any naming suggestions for the file?

included-sites
sites-include
include-only

@DrewAPicture
Copy link
Contributor

+1. This is a great idea.

@westonruter
Copy link
Contributor

As a big bonus for explicitly whitelisting paths to include, the performance of the provisioning will be drastically improved. If you have a lot of sites in your VVV like I do, and a lot of directories, it can take a long time for these find commands to search through the /srv/www directory tree (and it has to do it 3 times). So as part of this, we could switch to -maxdepth 1.

@tnorthcutt
Copy link
Contributor Author

Roger, so if the included-sites (do we like that name?) file is found, then also change the maxdepth flag to -1?

@westonruter
Copy link
Contributor

Yes, bingo. 👍

@ereckers
Copy link

This is something I've been struggling with. I also run a ton of sites out of /www that I wouldn't mind skipping at times, even though I like keeping them around to reference code while developing. In my use case, I always wondered if I could just drop a file in the project directory called something like vvv-skip, next to vvv-init.sh and vvv-nginx.conf.

@westonruter
Copy link
Contributor

I think the filename should be something like auto-setup-include-paths.

@jeremyfelt
Copy link
Member

Dig this idea. Agree with explicitly whitelisting paths to include.

I would love if this transitioned to a YAML config file over time, though I think we're okay with an individual file right now.

@tnorthcutt
Copy link
Contributor Author

@jeremyfelt YAML is far enough out of my reach that I'm not the one for that 😄.

I'll move forward with a simple text file, with each directory to include on a separate line.

@joeguilmette
Copy link

+1, this is great

@TobiasBg
Copy link
Contributor

How about copying the webserver approach for naming, i.e. something like sites-available and sites-enabled?

@alainux
Copy link

alainux commented Oct 21, 2014

+1

@westonruter
Copy link
Contributor

@TobiasBg the problem with that is the sites being enabled will be arbitrary paths, not just directory names. You can't (or shouldn't) have a file named www/acmeclient/example.com/config.

@EHLOVader
Copy link
Contributor

+1 but I have noted that there seems to be a lot of repeated work done when vagrant up or provision are run.

Would it be possible to only run the init.sh for unprovisioned sites or ones which changed? unless otherwise requested.

@jeremyfelt jeremyfelt added this to the 1.3 Release milestone Nov 13, 2014
@joeguilmette
Copy link

Any way I can help move this feature along? I'd also really love to be able to toggle the default sites on and off, hopefully before an initial vagrant up. It really grinds my gears having the default sites in there as they are now. They really should be provisioned by auto-site-setup like any other project you'd add.

@tnorthcutt
Copy link
Contributor Author

@joeguilmette feel free to chip in with a PR for this feature request. After evaluating it and trying a couple of angles, I've decided it's beyond my abilities/time for now.

@joeguilmette
Copy link

Just shooting from the hip, but what about moving the entire root folder
from vvv/www/ to vvv/disabled-sites/

Then we'd just need some way to tell VVV not to load the db for sites in
that folder, right?

Another change I'd like to see is making the default WP installs optional.
That might take some work but I'm willing to do it in the near future.

On Thu Nov 20 2014 at 9:48:09 PM Travis Northcutt notifications@github.com
wrote:

@joeguilmette https://github.com/joeguilmette feel free to chip in with
a PR for this feature request. After evaluating it and trying a couple of
angles, I've decided it's beyond my abilities/time for now.


Reply to this email directly or view it on GitHub
#474 (comment)
.

@EHLOVader
Copy link
Contributor

If you really wanted to archive the sites like that, you could keep a sibling folder named archive in the vvv/ and move sites from www to archive.

Possibly even better would be to symlink from a sites folder into www as you are working on them.

@jeremyfelt jeremyfelt modified the milestones: Next Release, Future Release Jul 20, 2015
@jeremyfelt jeremyfelt removed this from the Future Release milestone Aug 16, 2016
@jeremyfelt jeremyfelt removed this from the Future Release milestone Aug 16, 2016
@jeremyfelt jeremyfelt added this to the 1.5.0 milestone Nov 4, 2016
@jeremyfelt
Copy link
Member

It is now possible to selectively enable and disable sites through a YAML config file after the merge of #980. 🎉

@lock
Copy link

lock bot commented Feb 22, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Feb 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants