Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Jun 30, 2020. It is now read-only.
/vvPublic archive

🌐 Variable VVV - a VVV Site Creation Wizard.‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ❌ This project is no longer maintained. Please update your copy of VVV , which has most of the vv features built in.

License

NotificationsYou must be signed in to change notification settings

bradp/vv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 ██    ██ ██    ██░██   ░██░██   ░██     Variable VVV 1.12░░██ ░██ ░░██ ░██ ░░████   ░░████       The easiest way to set up  ░░██     ░░██        WordPress sites with VVV!   ░░       ░░

vv makes it extremely easy to create a new WordPress site usingVarying Vagrant Vagrants.vv supports site creation with many different options; site blueprints to set up all your plugins, themes, and more; deployments; and lots more features.

Travis

Tired of the time it takes to do avagrant provision or create new sites? Check outflip, a simple utility to solve that issue.

Table of Contents

Installation

OS X Installation

If you haveHomebrew installed, you run the following in your terminal application:

$ brew install bradp/vv/vv

Otherwise, clone this repositoy and edit your$PATH to include thevv core file:

  1. Clone this repo:git clone https://github.com/bradp/vv.git
  2. Add thevv core script to your shell's$PATH:
    • If you're usingbash:touch ~/.bash_profile && echo "export PATH=\$PATH:`pwd`/vv" >> ~/.bash_profile

Windows Installation

  • Clonevv to a folder somewhere.

    $ git clone https://github.com/bradp/vv.git

  • Add that folder to your system path. Seehere if you need help.

  • Open an explorer window and go to My Computer (or This PC).

  • Right click and choose properties

  • Choose Advanced System Settings

  • Choose Environmental Variables form the Advanced Tab

  • Choose the "Path" variable and edit it.

  • Add a semicolon to end the previous path item and then add thevv folder path (Example:;C:\Users\Name\Documents\vv)

  • Open Git Bash and runvv

Alternately, you can use cmd.exe withbash vv.

Props toVinsanity for these instructions. If you're having issues, please seethis issue.

Linux Installation

  • Clone vv into a folder.

    $ git clone https://github.com/bradp/vv.git

  • Access the directory that you cloned vv into.

  • Copy the vv executable to /usr/local/bin

    $ sudo cp vv /usr/local/bin

  • You should now be able to easily run vv from anywhere in your system.

Adding tab-completion tovv

Currently,vv supports tab-completion of arguments and options in both bash and ZSH. To enable this, you'll first want to make sure you're on the most current version ofvv. Then simply addsource $( echo $(which vv)-completions) to the end of your .bash_profile, .bashrc or .zshrc.

Updating

vv is currently under development, and you'll probably want the latest and greatest version at all times.

You can runvv --update to update to the latest version. This will update via Homebrew if you've installed it that way, otherwise vv will bootstrap an update on where ever you've installed it.

vv will automatically check for updates and update itself once a week. You can disable this by adding"auto_update_disable": false to the JSON config in~/.vv-config.

If you have trouble updating, you may want to try some of the options below:

Homebrew sometimes caches a version of Variable VV causing you to receive a message saying you are out of date with the Github version, however runningvv --update simply downloads a version you already have installed. In cases like this, there are two safe options you can try.

First, and simplest, runvv --force-update. Second, if that does not work you can safely uninstall Variable VV and re-install it via homebrew, you can do this with these commands:brew remove vv thenbrew untap bradp/vv and finally, run the install commandbrew install bradp/vv/vvas mentioned above. You will not lose any settings or sites.

Usage

Once installed, you can runvv anywhere you'd like. If vv can't automatically find your VVV installation, you will be prompted for the path. It will also save this into a configuration file in~/.vv-config, so you won't be prompted again.

At any time, you can runvv orvv --help to see a list of all possible options and flags.

vv will prompt you for a value for any required flags that were not specified.

The main commands arelist,create,delete. These will list your sites, create a site, and delete a site. These each have a few aliases, so for example, if you runvv show, vv will know you meantvv list.

To start creating a site, simply dovv create ( you can also dovv --create, or simplyvv -c). You will then be prompted for all required options.

All options and flags arelisted below.

Site Creation

vv create

Creating a site does the following:

  • Halts Vagrant (if running)
  • Creates a web root for the site in thewww folder containing three files:vvv-init.sh,wp-cli.yml, andvvv-hosts
    • vvv-init.sh tells Vagrant to create a database if one does not exist and install the latest version of WordPress (via WP-CLI) the next time Vagrant is provisioned
    • wp-cli.yml tells WP-CLI that WordPress is in the htdocs folder
    • vvv-hosts contains the hosts entry to give your site a nice custom domain (the domain is set in the wizard)
  • Creates a file in thenginx-config folder to handle server settings for your site
  • Restarts Vagrant withvagrant up --provision

Provisioning Vagrant takes a couple of minutes, but this is a crucial step as it downloads WordPress into your site's htdocs directory and runs the installation. If you want to skip provisioning and install WordPress manually, you can run the new site'svvv-init.sh file directly in the Vagrant shell.

Subdomain Multisite Installation

If you are using a subdomain multisite, you must edit vvv-hosts file inside of that site's folder with each subdomain on a new line. For example:

mysite.dev

siteA.mysite.dev

siteB.mysite.dev

After this, runvagrant reload --provision and your subdomains should resolve.Please note, any sites set up prior to version 1.7.3 will need more configuration for this, either delete and re-set up the site orping me on Twitter for help.

Site Deletion

vv delete site_name

You can also leave off site_name to be prompted for it.

Deleting a site does the following:

  • Halts Vagrant (if running)
  • Deletes the site's web root (which deletes thevvv-init.sh,wp-cli.yml, andvvv-hosts files as well)
  • Deletes the file in thenginx-config folder pertaining to the site
  • Deletes the database associated with the site

Deployments

vv deployment-create,vv deployment-remove,vv deployment-config

vv supports setting up deployments that work withVagrant Push. You'll need to be on version 1.7.0 or later of Vagrant. Simply runvv --deployment-create and walk through the wizard.

To deploy a site, you can dovv vagrant push <sitename>-<deployment_name>.

When removing a deployment, your current Vagrantfile will be backed up as Vagrantfile-backup.

Advanced Usage

Airplane Mode

Usingx as the first argument withvv will force airplane mode. This will cut off update checks on usage. This is useful if you're usingvv without an internet connection. The provision state of VVV will probably fail at some point, though.

Flags

Anything that vv prompts you for, you can pass in as an argument. Most of this is realized in the site creation. In fact, there are a few arguments you can pass in that aren't prompted. This gives you total control over creating a new site.

To create a new site named 'mysite' that has the domain 'mysite.dev' and is a multisite with subdomains, withWP_Debug turned on would be:

vv create -d mysite.dev -n mysite -m subdomains -x

Or, the more readable version with all expanded flags.

vv create --domain mysite.dev --name mysite --multisite subdomains --debug

To use a custom database prefix, simply use thevv create --prefix myprefix when creating a new site.

Blueprints

Blueprints allow you to set up different plugins, themes, mu-plugins, options, widgets, menus, or constants that will be installed to a new site you create. First, runvv --blueprint-init to have vv create avv-blueprints.json file in your VVV directory. You can edit this file to create and set up different blueprints.

A simple blueprint should look like this:

{"sample": {"themes": [      {"location":"automattic/_s","activate":true      }    ],"mu_plugins": [      {"location":"https://github.com/WebDevStudios/WDS-Required-Plugins.git"      }    ],"plugins": [      {"location":"https://github.com/clef/wordpress/archive/master.zip","version":null,"force":false,"activate":true,"activate_network":false      },      {"location":"cmb2","version":"2.0.5","force":false,"activate":true,"activate_network":false      }    ],"options": ["current_theme::_s"    ],"widgets": [      {"name":"meta","location":"sidebar-1","position":1,"options": {"title":"Site login or logout"        }      },      {"name":"text","location":"sidebar-2","position":4,"options": {"title":"Hello world.","text":"I'm a new widget."        }      }    ],"menus": [      {"name":"Example Menu","locations": ["primary","social"        ],"items": [          {"type":"post","post_id":2,"options": {"title":"Read the 'Sample Post'"            }          },          {"type":"custom","title":"Our Partner Site","link":"//example.com/","options": {"description":"Check out our partner's awesome website."            }          },          {"type":"term","taxonomy":"category","term_id":1,"options": {"title":"Example category"            }          }        ]      }    ],"demo_content": ["link::https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml"    ],"defines": ["WP_CACHE::false"    ]  }}

For themes, plugins, and mu-plugins, you can use:

  • Github username/repo
  • Full git url
  • Url to zip file
  • WordPress.org slug

The options for plugins, themes, widgets, and menus correspond to the equivalentWP CLI option.

For options, demo content, and constants, please note the:: as a separator between the key and value.

Custom demo content can be imported through the blueprint. Be sure to use a link that points to just the xml code, likethis. You can add as many demo content files as you'd like, just separate each line with a comma as usual.

A multisite's Network Settings can be configured using anetwork_options array in the blueprint.

You can create as many named blueprints in this file as you would like, all with as many different settings as you'd like.

When creating a site, the name you've specified (in this example, "sample") is what you'll need to specify to use this blueprint.

You can use 'SITENAME' or 'SITEDOMAIN' anywhere in the blueprint, and that will be replaced with the actual site name or local domain when installing.

Blueprints for Multisite configurations

Blueprints also let you set up individual subsites in a Multisite network. For example, you can define a blueprint for a multisite network in which certain plugins or themes are activated across the whole network, or just for specific subsites.

To add multisite support to your blueprint, add asites key to a specific blueprint, like this:

"sites": {"site2": {"plugins": ["...(same as above)..."    ]  }}

Thesites object holds a subsite definition, which has the same capabilities as a regular site's blueprint (soplugins,themes, etc. are all the same), and also includes keys forWP-CLI'swp site create command. For example, to create a subsite whose slug issubsite2, titled "Second Subsite" with an admin email address ofsubsite2admin@localhost.dev withrobots.txt exclusions, use:

"sites": {"subsite2": {"title":"Second Subsite","email":"subsite2admin@localhost.dev"  }}

If your multisite network uses subdomains, you can include a blueprint-level key named likeBLUEPRINT_NAME::subdomains to havevv configure your subdomains for you.BLUEPRINT_NAME should match the name of your blueprint, and the value should be a space-separated list of subdomains that match your subsite slugs. A complete example for thesample blueprint shown above using subdomain-based multisite configurations might look like this:

{"sample": {"sample::subdomains":"site2 site3","sites": {"site2": {"title":"Child Site (subsite2)","plugins": [          {"location":"buddypress","activate":true          }        ]      },"site3": {"title":"Private Child Site","private":true,"email":"site2admin@local.dev","themes": [          {"location":"https://github.com/glocalcoop/anp-network-main-child/archive/master.zip","activate":true          }        ]      }    },"themes": [      {"location":"automattic/_s","enable_network":true      },      {"location":"glocalcoop/anp-network-main-v2","activate":true      }    ],"mu_plugins": [      {"location":"https://github.com/WebDevStudios/WDS-Required-Plugins.git"      }    ],"plugins": [      {"location":"https://github.com/clef/wordpress/archive/master.zip","version":null,"force":false,"activate":true,"activate_network":false      },      {"location":"cmb2","version":"2.0.5","force":false,"activate":true,"activate_network":false      },    ],"demo_content": ["link::https://raw.githubusercontent.com/manovotny/wptest/master/wptest.xml"    ],"defines": ["WP_CACHE::false"    ]  }}

The above installsBuddyPress but activates it only forsite2, enables the_s theme for the entire network but activatesanp-network-main-v2 for the network's main site andanp-network-main-child forsite3, which is also given its own site admin user.

Be sure to runvv with the--multisite subdomain option when you use a blueprint like this.

Blueprints for Multi-Network configurations

In addition to amultisite configuration, VV recognizes blueprints that will configure a WP Multi-Network (a network of WP Multisite networks). VV's Multi-Network blueprints work just like Multisite blueprints, but have the following required additions:

  • ABLUEPRINT_NAME::subnetwork_domains key must be present listing the root domains for each network.
  • Anetworks object must be present, whose keys match the domains listed in theBLUEPRINT_NAME::subnetwork_domains member.

For example, this Multi-Network configuration defines two WP Multisite subnetworks (for a total of three WP Multisites) in the blueprint calledmultinet.

{"multinet": {"multinet::subdomains":"site2 site3","multinet::subnetwork_domains":"wpsubnet1.dev wpsubnet2.dev","networks": {"wpsubnet1.dev": {"path":"/","site_name":"WP Subnetwork Example 1"      },"wpsubnet2.dev": {"path":"/","site_name":"WP Subnetwork Example 2"      }    }  }}

Note that empty network objects are allowed (i.e.,path andsite_name are optional), but not recommended.

To associate a given subsite with a network, you can either use thenetwork_id key or anetwork_domain key in the subsite object. Anetwork_domain is recommended. For example, this object will associate thesite2 subsite with the main network (because nonetwork_domain ornetwork_id key is defined), and the subsite with slugsite3 with the network created at the given domain:

{"site2": {  },"site3": {"network_domain":"wpsubnet1.dev"  }}

The above will ultimately placesite3 at thesite3.wpsubnet1.dev URL whilesite2 will be created as a subdomain of whatever domain you chose when you invokedvv create.

It is not an error for a WP network to be defined with no sites of its own.

Vagrant Proxy

Because vv knows where you VVV installation is, you can run it from anywhere. vv will proxy any commands passed intovv vagrant <command> to your VVV location. Sovv vagrant halt will halt your VVV vagrant, no matter where you run it.

vv Options

OptionDescription
--help,-hShow help and usage
--versionShow current vv version number.
--aboutShow about screen.
--updateUpdates vv to the latest stable version
--debug-vvOutputs all debugging info needed for bug reporting.
--path,-pPath to VVV installation
--force-path,-fpOverride vv auto-VVV locating
--force-sites-folder,-fsfOverride sites folder directory locating
--defaultsAccept all default options and skip the wizard. You can also run `yes

Commands

CommandDescription
list,--list,-lList all VVV sites
create,--create,-cCreate a new site
delete,--delete,-rDelete a site
deployment-create,--deployment-createSet up deployment for a site
deployment-remove,--deployment-removeRemove deployment for a site
deployment-config,--deployment-configManually edit deployment configuration
blueprint-init,--blueprint-initInitalize blueprint file
vagrant,v,--vagrant,-vPass vagrant command through to VVV.

Options for Site Creation

OptionDescription
--name,-nDesired name for the site directory (e.g. mysite)
--domain, -dDomain of new site
--webroot,-wrSubdirectory used for web server root
--bedrock,-bedCreates Roots.io Bedrock install
--blueprint,-bName of blueprint to use
--live-url,-uLive URL of site
--files,-fDo not provision Vagrant, just create the site directory and files
--images,-iLoad images by proxy from the live site
--wp-version,-wvVersion of WordPress to install
--debug,-xTurn on WP_DEBUG and WP_DEBUG_LOG
--multisite,-mInstall as a multisite. Can also pass in "subdomain" or "subdirectory"
--sample-content,-scAdds sample content to site.
--usernameAdmin username
--passwordAdmin password
--emailAdmin email
--prefixDatabase prefix to use
--git-repo,-grGit repo to clone as wp-content
--path,-pPath to VVV installation
--force-path,-fpOverride vv auto-VVV locating
--blankCreates blank VVV site, with no WordPress
--blank-with-dbCreates a blank VVV site, with a database
--wpskeleton,-skelCreates a new site with the structure ofWP Skeleton
--database,-dbImports a local database export
--remove-defaults,-rdRemoves default themes and plugins
--language,--localeInstall WP in another locale. Need to pass the locale afterwards, like so:vv create --locale fr_FR

Options for Site Removal

OptionDescription
--name,-nDesired name for the site directory (e.g. mysite)
--path,-pPath to VVV installation
--force_path,-fpOverride vv auto-VVV locating

Options for Deployment Setup

OptionDescription
--name,-nDesired name for the site directory (e.g. mysite)
--deployment-nameName of deployment (production, staging, other, etc)
--hostHost (if SFTP, define port as host:port)
--usernameFTP Username
--passwordFTP Password
--passiveUse Passive transfer mode? (y/n)
--secureUse SFTP? (y/n)
--destinationDestination path ( You probably want / or ~/public_html )
--confirm-removalUsed when removing a deployment to skip the confirmation prompt

.vv-config

The first time you runvv, it will attempt to locate your VVV installation location. If it can't find it, you will be prompted for it. This will be written to a .vv-config file in your home directory. (~/.vv-config) You can also edit this file if you need to change your VVV path.

Also, ifvv detects a.vv-config file in your current directory, this local file will override the one in your home directory. A use case would be to have several differentVVV installations, that each contain their own local.vv-config file. Provided that you enter the appropriate directory before sending commands tovv, this effectively allows you to manage several different installations through one user account.

You can also add"auto_update_disable": false to this file to disable auto-update functionality.

vv Hooks

vv has support for extensibility within the 'hooks' system present. This allows for quite a lot of extensibility and injection into thevv process. This system allows you to add your own code to run within almost any point withvv.

To get started with hooks, run anyvv command with--show-hooks at the end. For example,vv list --show-hooks will runvv list as normal, but will also show all the hooks available.

To create the folder that your hook code should live in, simply make a 'vv' folder inside of your VVV folder.

To add code to run for a hook, make a file within your vv folder inside of VV named the hook that you want to add to. This file can be any command line runnable language, and will be executed inline.

For example, saving this file as the name of any hook will output 'Hello' when that hook gets called.

#! /usr/bin/phpecho'Hello'

Another example would be running npm install inside of wp-content for all new sites.

Make a file named post_site_creation_finished. This file gets 4 variables passed in: the hook name, the name of the site folder, the site domain, and the VVV path.

#!/bin/bashcd www/"$2"/htdocs/wp-content||exit    npm install

Thanks

Forked and based off ofvvv-site-wizard from Alison Barrett.Also thanks tomeitar,creativecoder,jtsternberg,caseypatrickdriscoll,gregrickaby,leogopal,ajdruff,schlessera,john-g-g,tnorthcutt,wpsmith,wesbos,protechig,Ipstenu,justintucker,michaelbeil,jb510,neilgee,nanomoffet,joehills,JeffMatson,greatislander,pelmered,gMagicScott,alexschlueter,eriktdesign,WPprodigy,michaelryanmcneill,boborchard,cryptelli,lswilson,Mte90 for their contributions.

About

🌐 Variable VVV - a VVV Site Creation Wizard.‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ‎ ❌ This project is no longer maintained. Please update your copy of VVV , which has most of the vv features built in.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp