Git Product home page Git Product logo

bradp / vv Goto Github PK

View Code? Open in Web Editor NEW
1.0K 59.0 90.0 639 KB

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

License: GNU General Public License v2.0

Shell 100.00%
wordpress local-development vvv varying-vagrant-vagrants vv

vv's Introduction

Variable VVV - The Best VVV Site Wizard

 ██    ██ ██    ██
░██   ░██░██   ░██     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 using Varying 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 a vagrant provision or create new sites? Check out flip, a simple utility to solve that issue.

Table of Contents

Installation

OS X Installation

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

$ brew install bradp/vv/vv

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

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

Windows Installation

  • Clone vv to a folder somewhere.

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

  • Add that folder to your system path. See here 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 the vv folder path (Example: ;C:\Users\Name\Documents\vv)

  • Open Git Bash and run vv

Alternately, you can use cmd.exe with bash vv.

Props to Vinsanity for these instructions. If you're having issues, please see this 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 to vv

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 of vv. Then simply add source $( 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 run vv --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 running vv --update simply downloads a version you already have installed. In cases like this, there are two safe options you can try.

First, and simplest, run vv --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 then brew untap bradp/vv and finally, run the install command brew install bradp/vv/vvas mentioned above. You will not lose any settings or sites.

Usage

Once installed, you can run vv 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 run vv or vv --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 are list, 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 run vv show, vv will know you meant vv list.

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

All options and flags are listed below.

Site Creation

vv create

Creating a site does the following:

  • Halts Vagrant (if running)
  • Creates a web root for the site in the www folder containing three files: vvv-init.sh, wp-cli.yml, and vvv-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 the nginx-config folder to handle server settings for your site
  • Restarts Vagrant with vagrant 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's vvv-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, run vagrant 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 or ping 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 the vvv-init.sh, wp-cli.yml, and vvv-hosts files as well)
  • Deletes the file in the nginx-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 with Vagrant Push. You'll need to be on version 1.7.0 or later of Vagrant. Simply run vv --deployment-create and walk through the wizard.

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

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

Advanced Usage

Airplane Mode

Using x as the first argument with vv will force airplane mode. This will cut off update checks on usage. This is useful if you're using vv 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, with WP_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 the vv 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, run vv --blueprint-init to have vv create a vv-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 equivalent WP 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, like this. 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 a network_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 a sites key to a specific blueprint, like this:

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

The sites object holds a subsite definition, which has the same capabilities as a regular site's blueprint (so plugins, themes, etc. are all the same), and also includes keys for WP-CLI's wp site create command. For example, to create a subsite whose slug is subsite2, titled "Second Subsite" with an admin email address of [email protected] with robots.txt exclusions, use:

"sites": {
  "subsite2": {
    "title": "Second Subsite",
    "email": "[email protected]"
  }
}

If your multisite network uses subdomains, you can include a blueprint-level key named like BLUEPRINT_NAME::subdomains to have vv 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 the sample 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": "[email protected]",
        "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 installs BuddyPress but activates it only for site2, enables the _s theme for the entire network but activates anp-network-main-v2 for the network's main site and anp-network-main-child for site3, which is also given its own site admin user.

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

Blueprints for Multi-Network configurations

In addition to a multisite 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:

  • A BLUEPRINT_NAME::subnetwork_domains key must be present listing the root domains for each network.
  • A networks object must be present, whose keys match the domains listed in the BLUEPRINT_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 called multinet.

{
  "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 and site_name are optional), but not recommended.

To associate a given subsite with a network, you can either use the network_id key or a network_domain key in the subsite object. A network_domain is recommended. For example, this object will associate the site2 subsite with the main network (because no network_domain or network_id key is defined), and the subsite with slug site3 with the network created at the given domain:

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

The above will ultimately place site3 at the site3.wpsubnet1.dev URL while site2 will be created as a subdomain of whatever domain you chose when you invoked vv 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 into vv vagrant <command> to your VVV location. So vv vagrant halt will halt your VVV vagrant, no matter where you run it.

vv Options

Option Description
--help, -h Show help and usage
--version Show current vv version number.
--about Show about screen.
--update Updates vv to the latest stable version
--debug-vv Outputs all debugging info needed for bug reporting.
--path, -p Path to VVV installation
--force-path, -fp Override vv auto-VVV locating
--force-sites-folder,-fsf Override sites folder directory locating
--defaults Accept all default options and skip the wizard. You can also run `yes

Commands

Command Description
list, --list, -l List all VVV sites
create, --create, -c Create a new site
delete, --delete, -r Delete a site
deployment-create, --deployment-create Set up deployment for a site
deployment-remove, --deployment-remove Remove deployment for a site
deployment-config, --deployment-config Manually edit deployment configuration
blueprint-init, --blueprint-init Initalize blueprint file
vagrant, v, --vagrant, -v Pass vagrant command through to VVV.

Options for Site Creation

Option Description
--name, -n Desired name for the site directory (e.g. mysite)
--domain, -d Domain of new site
--webroot, -wr Subdirectory used for web server root
--bedrock, -bed Creates Roots.io Bedrock install
--blueprint, -b Name of blueprint to use
--live-url, -u Live URL of site
--files, -f Do not provision Vagrant, just create the site directory and files
--images, -i Load images by proxy from the live site
--wp-version, -wv Version of WordPress to install
--debug, -x Turn on WP_DEBUG and WP_DEBUG_LOG
--multisite, -m Install as a multisite. Can also pass in "subdomain" or "subdirectory"
--sample-content,-sc Adds sample content to site.
--username Admin username
--password Admin password
--email Admin email
--prefix Database prefix to use
--git-repo,-gr Git repo to clone as wp-content
--path, -p Path to VVV installation
--force-path, -fp Override vv auto-VVV locating
--blank Creates blank VVV site, with no WordPress
--blank-with-db Creates a blank VVV site, with a database
--wpskeleton, -skel Creates a new site with the structure of WP Skeleton
--database,-db Imports a local database export
--remove-defaults,-rd Removes default themes and plugins
--language,--locale Install WP in another locale. Need to pass the locale afterwards, like so: vv create --locale fr_FR

Options for Site Removal

Option Description
--name, -n Desired name for the site directory (e.g. mysite)
--path, -p Path to VVV installation
--force_path, -fp Override vv auto-VVV locating

Options for Deployment Setup

Option Description
--name, -n Desired name for the site directory (e.g. mysite)
--deployment-name Name of deployment (production, staging, other, etc)
--host Host (if SFTP, define port as host:port)
--username FTP Username
--password FTP Password
--passive Use Passive transfer mode? (y/n)
--secure Use SFTP? (y/n)
--destination Destination path ( You probably want / or ~/public_html )
--confirm-removal Used when removing a deployment to skip the confirmation prompt

.vv-config

The first time you run vv, 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, if vv 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 different VVV installations, that each contain their own local .vv-config file. Provided that you enter the appropriate directory before sending commands to vv, 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 the vv process. This system allows you to add your own code to run within almost any point with vv.

To get started with hooks, run any vv command with --show-hooks at the end. For example, vv list --show-hooks will run vv 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/php
    echo '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/bash
    cd www/"$2"/htdocs/wp-content || exit
    npm install

Thanks

Forked and based off of vvv-site-wizard from Alison Barrett. Also thanks to meitar, 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.

vv's People

Contributors

ajdruff avatar bradp avatar caseydriscoll avatar cryptelli avatar eriktdesign avatar fabacab avatar floscr avatar gmagicscott avatar gregrickaby avatar ipstenu avatar jb510 avatar jeffmatson avatar joehills avatar john-g-g avatar jtsternberg avatar leogopal avatar lswilson avatar michaelbeil avatar michaelryanmcneill avatar mte90 avatar nanomoffet avatar neilgee avatar ollietreend avatar pelmered avatar schlessera avatar sdulaney avatar tomjn avatar wesbos avatar wpsmith avatar zachary-russell avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vv's Issues

vv doesn't work anymore

I get this weird message when I try to run vv from Terminal:

/Users/chantal/GitHub/vv/vv: line 651: syntax error near unexpected token <<<' /Users/chantal/GitHub/vv/vv: line 651:<<<<<<< Updated upstream'

Tried to reboot, doesn't solve it. I am puzzled.

Any ideas how to solve this?

Install into www subfolder

Is it possible to use vv and have WordPress be installed in a www subfolder? I was able to use the -wr command and choose a subfolder within the project, but I'd like to install into www/projects instead of the www root.

Feature request: new options on `vv create`

I have run into cases during vv create where I think some basic flags/options should be available

  1. Accept a SQL file for an existing DB. I imagine this would copy the .sql to the database/backups folder prior to vagrant provision.
  2. Allow override on certain settings for the wp_config file. I really want to be able to specify the table prefixes when switching existing projects over to my VVV workflow.

Am I missing the point?
Does anything like this exist?
If I wanted to dig in and contribute where would I start?

New installs fail

Disclaimer: I suspect this may be an issue with my VVV setup, rather than an issue with vv, but I'm not certain.

When I try to setup a new site with vv, it fails, partially. From what I can tell, the actual install of WP is what fails. Here are screenshots:

image

When it tries to install WP:
2014-12-30 at 4 53 pm

After the process completes, test/htdocs is empty, as is the newly created database. The contents of test/vvv-init.sh is as follows:

echo "Creating database 'test' (if it does not exist)..."
mysql -u root --password=root -e "CREATE DATABASE IF NOT EXISTS \`test\`"
mysql -u root --password=root -e "GRANT ALL PRIVILEGES ON \`test\`.* TO wp@localhost IDENTIFIED BY 'wp';"

if [ ! -d "htdocs/wp-admin" ]; then
    echo 'Installing WordPress (release version) in test/htdocs...'
    mkdir ./htdocs
    cd ./htdocs
    wp core download --allow-root
    wp core config --dbname="test" --dbuser=wp --dbpass=wp --dbhost="localhost" --allow-root
    wp core install --url=test.dev --title="test" --admin_user=admin --admin_password=password [email protected] --allow-root


    cd -

fi

I have a hunch that the autoload.php error points to a Composer issue, but I know next to nothing about that, so I could be totally off base. Any suggestions for debugging?

Allow use of existing directory in `www/` for new site setup

Sometimes I want to setup vvv site within an existing directory in www/. Maybe I've already cloned a git repo into that folder, or maybe I want to rerun site configuration for some reason, without manually changing the files.

Seems like this has a few implications

  • Disable directory check when prompted for site name. Instead check for nginx configuration file.
  • Don't offer to clone a git repo, if the directory already exists
  • Conditionally do mkdir, only if the directory isn't already there
  • Anything I'm missing?

I'll submit a pull request if you think this would be a good feature to add. Thanks, Grant

"vv --deployment-create" appends changes to Vagrantfile

I'm new to Vagrant, so apologies if I'm misunderstanding this error.

I created a new deployment using vv --deployment-create and afterwards, all Vagrant commands (even vagrant status) failed with the error:

Path: /Users/joehills/vagrant-local/Vagrantfile
Message: undefined local variable or method `config' for main:Object

Since git status showed that the only change to the Vagrantfile was appending the push code to the end of it, I removed the newly generated config.push definition and all was well again.

On a hunch, I tried moving the push code manually inside the final end and was able to vv -v push properly. I'm no Ruby expert, but I'm guessing that was the intended behavior of vv --deployment-create in the first place?

I hope this helps someone with more Vagrantfile/ruby experience than me sort out a patch! Thanks!

Build out .vv-config options.

I really want to support adding defaults to vv-config, as well as "blueprints" of site installations. Blue prints should support grabbing from Github, a WP.org slug, an arbirtary git repo, or a random zip file.

{
    "path": "~/vagrant",
    "defaults" : {
        "debug" : true,
        multisite : false
    }
    "blueprints": {
        "wds" : {
            "wp-content" {
                "themes" : {
                    automattic/_s
                }
                "mu-plugins" : {
                    "extra" : {
                        https://github.com/WebDevStudios/CMB2.git
                    },
                    "WebDevStudios/CMB2",
                },
                "plugins" : {
                    'jetpack',
                    'http://example.com/sample-plugin.zip',
                },
            },
            "options" : {
                "active_theme" : "_s"
            },
            "definitions" : {
                "WP_DEBUG" : true,
                "GF_KEY" : 837r8rerihf87r
            }
        },
        "some-other-project" : {
            "wp-content" {}
            "options" : {}
        }
    }
}

vv --update does not update

I'm currently on 1.4.6. When I run vv --update, I see the following:

Updating vv via Brew...
==> Reinstalling vv
==> Downloading https://github.com/bradp/vv/archive/1.4.6.tar.gz
Already downloaded: /Library/Caches/Homebrew/Vv-1.4.6.tar.gz
🍺  /usr/local/Cellar/vv/1.4.6: 4 files, 72K, built in 2 seconds

Screenshot:
2014-12-24 at 6 11 am

Any suggestions on how to troubleshoot, or force an update?

Setting missing when creating a subdomain multi-site installation

Unless I'm missing something obvious the current vv create process doesn't add the needed settings in either the hosts file (and possibly someting in nginx as well?). I just created a multi-site installation and upon selecting a sub domain installation multi-site configuration I went ahead and created my first subsite only to discover it doesn't actually resolve in the browser.

blueprints: installing themes and plugins fails, warning about root access

when using a blueprint, for every theme and plugin, and eve option that I have listed, I get this big red warning output

==> default: Setting up blueprint somatic...
==> default: Installing themes...
==> default: Error: YIKES! It looks like you're running this as root. You probably meant to run this as the user that your WordPress install exists under.
==> default: 
==> default: If you REALLY mean to run this as root, we won't stop you, but just bear in mind that any code on this site will then have full control of your server, making it quite DANGEROUS.
==> default: 
==> default: If you'd like to continue as root, please run this again, adding this flag:  --allow-root
==> default: 
==> default: If you'd like to run it as the user that this site is under, you can run the following to become the respective user:
==> default: 
==> default:     sudo -u USER -i -- wp <command>

but strangely, I don't get the error when it comes to mu-plugins

==> default: Installing mu-plugins...
==> default: Cloning into 'WDS-Required-Plugins'...

so at the end of it all, the install does work, and the site runs, but I have none of the themes, plugins, or options from the blueprint -- just the mu-plugins

Unable to import example data on site build

Version: vv version 1.5.0

Ran through wizard to create a new site (vv create). While creating the new site, it fails to import the dummy data if the WordPress importer is not installed:

==> default: Installing WordPress (release version) in example/htdocs...
==> default: Downloading WordPress 4.1 (en_US)...
==> default: Using cached file '/home/vagrant/.wp-cli/cache/core/en_US-4.1.tar.gz'...
==> default: Success: WordPress downloaded.
==> default: Success: Generated wp-config.php file.
==> default: Success: WordPress installed successfully.
==> default: Error: WordPress Importer needs to be installed. Try 'wp plugin install wordpress-importer --activate'.
==> default: /srv/www/example
==> default: Setting up blueprint default...
==> default: Blueprint set up.

Option to copy arbitrary files into site root on creation

I often create my WordPress git repos at the site root level and then use the .gitignore file to only version control files in the wp-content directory (except for uplooads). It would be nice to be able to automatically bring that file in or clone it from a git repo at the site root level.

I know we can clone wp-content folder on creation now, I'd just like to do the same thing up one level at the site root.

Sorry if there is a way to do this already--I'm still trying to learn.

Add documentation

Now that VV is pretty stable and has a good amount of features, docs would be real nice.

Installation

  • Installation
  • Adding to your path
  • setting up .vv-config
  • using homebrew to install

Flags

  • Flags
  • -- help, -h:
  • -- list, -l, list
  • -- create, -c, create
  • -- remove, -r, remove
  • -- path, -p
  • -- domain, -d
  • -- live_url, -u
  • -- files, -f
  • -- images, -i
  • -- name, -n
  • -- version, -v
  • -- debug, -x
  • -- multisite, -m
  • -- username
  • -- password
  • -- email
  • -- git_repo

Only provision the new site

Not sure if this is possible or not, but figured I'd see what you think.

I use the same VVV instance for multiple sites. But when I create a new site, it'll go through all the sites on the instance and create the db, install files, etc. It'd be cool if there was a way to just add the new site during the creation and not re-create the whole entire instance.

Does this make sense at all?

Feature request: Add option to accept default prompts

I'm currently master (future 1.4.7). I have an alias setup that looks like this:
alias newcgd="vv -c --git-repo https://github/mycoolrepo.git -n"

This allows me to run:
newcgd test

And save quite a few keystrokes. However, it would be super awesome if there were a flag I could pass that says "accept defaults and run" so I don't get prompted for things like blueprint, defines, etc.

Error When Attempting a Deployment

I run vv deployment-create

I follow all the prompts. Run the command to deploy, then the following error graces my terminal.

Leos-MacBook-Pro:vagrant-local leogopal$ vv -v push gfntv-staging
There is a syntax error in the following Vagrantfile. The syntax error
message is reproduced below for convenience:

/Users/leogopal/vagrant-local/Vagrantfile:221: syntax error, unexpected keyword_end, expecting end-of-input
;

Deal with sites in subfolders

I like to keep my /www/ folder a little bit organised with various folders containing a certain group of sites. It'd be wonderful if VV could create and delete in specified subfolders.

When creating a site, provisioning doesn't run automatically

Is this by design?

The messaging during the wizard reminds you to run it, but when I look at this I see evidence it is intended to run magically:
https://github.com/bradp/vv/blob/master/vv#L697

Is this because $files_only has no default value? My bash scripting syntax is a bit week, so it isn't entirely clear to me what is happening in that conditional.

I presume the intended meaning is: if $files_only is false

Which leads me to conclude $files_only needs a default value.

Clif

Add deployment capability

@jtsternberg had a good idea.

Vagrant just added vagrant push.

Let's get vv to set those up.

  • When setting up a site, prompt for deployment setup (with multiple deploys? (staging, prod) )
  • add a vv wrapper to vagrant push

I've updated vv to 1.4.8 but

for whatever reason, I'm getting [Error] Unknown option delete when I try and delete a site.

This is my first try at using vv and when I created a site, it didn't actually run the provisioning. It created the dir and the files, but never created the htdocs or downloaded WordPress. So I thought maybe I read/did something wrong and came back to see if there was an update (which I ran vv --update) and tried to delete the site it made and still Unknown option. Any thoughts?

Fix the colors in output

Just helped @ImBigWill and the blue sucked with his terminal color scheme.

Not sure if I tested this with more than like 2 color schemes.

Also not sure the best way to solve this

[Error] Path specified is not a VVV root directory.

I had VVV installed before and also VV. I then removed VVV and later reinstalled it. Now VV seems to be still installed in an older version but whatever I try to do I get the message "[Error] Path specified is not a VVV root directory." How can I either remove VV or update it or how can I give VV the right path information or "Otherwise you'll want to clone and edit your $PATH to include the vv core file."? is what the README says but I don't understand.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.