Skip to content

Commit

Permalink
3.9.1 stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
tomjn committed Apr 13, 2022
2 parents 8252690 + 8853d4a commit fabccb8
Show file tree
Hide file tree
Showing 35 changed files with 542 additions and 145 deletions.
9 changes: 6 additions & 3 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ body:
attributes:
label: Whats the problem?
description: |
Be as descriptive as possible.
Be as descriptive as possible!!!
validations:
required: true
- type: textarea
Expand Down Expand Up @@ -63,7 +63,8 @@ body:
description: You can do this by searching https://github.com/WordPress/gutenberg/issues and making sure the bug is not related to another plugin.
multiple: false
options:
- 'Apple MacOS'
- 'Apple MacOS (Intel)'
- 'Apple MacOS (Arm/Apple Silicon)'
- 'Microsoft Windows'
- 'Linux'
- 'Other'
Expand All @@ -76,7 +77,9 @@ body:
multiple: false
options:
- 'VirtualBox'
- 'Parallels'
- 'Parallels (Intel)'
- 'Parallels (Apple Silicon/Arm)'
- 'Hyper-V'
- 'VMWare'
- 'Other'
validations:
Expand Down
22 changes: 20 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ permalink: /docs/en-US/changelog/

# Changelog

## 3.9.1 ( 2022 April 13th )

### Enhancements

* VVV now switches to Parallels by default on Arm machines ( #2560 )
* Adds default Nginx pages for 40x and 50x errors to help on troubleshooting ( #2345 )
* NVM is now used to manage NodeJS, VVV will auto-switch the node version to that used by `.nvmrc` when inside the guest VM ( #2581 )
* The PHP Redis extension is now installed with the default PHP version ( #2582 )

### Bug Fixes

* Refactored the certificate check to check for the certificate file, not the TLS-CA utility ( #2563 )
* Fixed an issue with `composer create-project` not running when specified in `config.yml` ( #2565 )
* Switched obsolete mirror check for MariaDB to the one already used (#2575)
* Fixed a broken warning in the network checks
* Fixed an issue with `/root/.local/share/composer` when provisioning (#2589)
* Fixed an issue with the new Git release that was crashing the provisioner beucase of wrong user permissions ( #2593 )

## 3.8.1 ( 2021 November 15th )

### Enhancements
Expand Down Expand Up @@ -579,7 +597,7 @@ The decision to include breaking changes in a release is not made lightly. The n
* ***Possible Breaking:*** Ubuntu has been upgraded from 12.04 LTS to 14.04 LTS. We have also moved from 32bit to 64bit.
* A full `vagrant destroy` is recommended for best results.
* A new box will be downloaded for the base virtual machine. If you'd like to free space, remove the old box with `vagrant box remove precise32`. Running `vagrant box list` will show you all base VMs on your local machine.
* With a new operating system comes a new RSA key. If you are connecting via SSH through an application that relies on your machines `known_hosts` file, you will need to clear the old key for 192.168.50.4. [See #365](https://github.com/Varying-Vagrant-Vagrants/VVV/issues/365)
* With a new operating system comes a new RSA key. If you are connecting via SSH through an application that relies on your machines `known_hosts` file, you will need to clear the old key for 192.168.56.4. [See #365](https://github.com/Varying-Vagrant-Vagrants/VVV/issues/365)
* Init scripts are now fired with `source` rather than `bash`. Due to this change, something like `cd "$(dirname $0)"` no longer works as expected. See [#373](https://github.com/Varying-Vagrant-Vagrants/VVV/issues/373) and [#370](https://github.com/Varying-Vagrant-Vagrants/VVV/issues/370) for reasoning and discussion.
* WordPress: Add `develop_git` to convert the default SVN checkout to Git.
* PHP: Update to PHP 5.5.x
Expand Down Expand Up @@ -678,7 +696,7 @@ The decision to include breaking changes in a release is not made lightly. The n
* Refactor handling of custom PHP, APC, and xdebug configurations
* Bump default memcached memory allocation to 128M
* Introduce custom `apc.ini` file, bump `apc.shm_size` to 128M
* Provide a phpinfo URL at `http://192.168.50.4/phpinfo/`
* Provide a phpinfo URL at `http://vvv.test/phpinfo/`
* Set `WP_DEBUG` to true by default for included installations of WordPress

## 0.6
Expand Down
21 changes: 13 additions & 8 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

# -*- mode: ruby -*-
# vi: set ft=ruby ts=2 sw=2 et:

VAGRANTFILE_API_VERSION = "2"

Vagrant.require_version '>= 2.2.4'
require 'yaml'
require 'fileutils'
Expand Down Expand Up @@ -211,6 +214,12 @@ defaults = {}
defaults['memory'] = 2048
defaults['cores'] = 1
defaults['provider'] = 'virtualbox'

# if Arm default to parallels
if Etc.uname[:version].include? 'ARM64'
defaults['provider'] = 'parallels'
end

# This should rarely be overridden, so it's not included in the config/default-config.yml file.
defaults['private_network_ip'] = '192.168.56.4'

Expand Down Expand Up @@ -317,12 +326,8 @@ end

ENV['LC_ALL'] = 'en_US.UTF-8'

Vagrant.configure('2') do |config|
# Store the current version of Vagrant for use in conditionals when dealing
# with possible backward compatible issues.
vagrant_version = Vagrant::VERSION.sub(/^v/, '')

# Configurations from 1.0.x can be placed in Vagrant 1.1.x specs like the following.
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# VirtualBox
config.vm.provider :virtualbox do |v|
v.customize ['modifyvm', :id, '--uartmode1', 'file', File.join(vagrant_dir, 'log/ubuntu-cloudimg-console.log')]
v.customize ['modifyvm', :id, '--memory', vvv_config['vm_config']['memory']]
Expand Down Expand Up @@ -463,7 +468,7 @@ Vagrant.configure('2') do |config|
#
# A private network is created by default. This is the IP address through which your
# host machine will communicate to the guest. In this default configuration, the virtual
# machine will have an IP address of 192.168.50.4 and a virtual network adapter will be
# machine will have an IP address of 192.168.56.4 and a virtual network adapter will be
# created on your host machine with the IP of 192.168.50.1 as a gateway.
#
# Access to the guest machine is only available to your local host. To provide access to
Expand Down Expand Up @@ -697,7 +702,7 @@ Vagrant.configure('2') do |config|
config.vm.provision "flag-root-vagrant-command", type: 'shell', keep_color: true, inline: "mkdir -p /vagrant && touch /vagrant/provisioned_as_root"
end
end

long_provision_bear = <<~HTML
#{blue}#{creset}
#{blue} ▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄ ▄ ▄ #{green}A full provision will take a bit.#{creset}
Expand Down
3 changes: 1 addition & 2 deletions config/homebin/switch_php_debugmod
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
#!/usr/bin/env bash
set -eo pipefail


source /srv/provision/provision-helpers.sh

# Grab the currently active PHP mods, and lowercase it for comparison
Expand Down
2 changes: 1 addition & 1 deletion config/wordpress-config/wp-tests-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
} else if ( file_exists( '/vagrant' ) ) {
define( 'DB_HOST', 'localhost' );
} else {
define( 'DB_HOST', '192.168.50.4' );
define( 'DB_HOST', '192.168.56.4' );
}
define( 'DB_NAME', getenv( 'WP_TESTS_DB_NAME' ) ?: 'wordpress_unit_tests' );
if ( getenv( 'WP_TESTS_DB_USER' ) ) {
Expand Down
65 changes: 44 additions & 21 deletions provision/core/composer/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,84 @@
set -eo pipefail

# @noargs
function composer_setup() {
function composer_pre_setup() {
# Disable XDebug before any Composer provisioning.
vvv_info " * Turning off XDebug to avoid Composer performance issues"
sh /srv/config/homebin/xdebug_off
vvv_info " * [Composer]: Turning off PHP debug mods to avoid Composer performance issues"
/srv/config/homebin/switch_php_debugmod none
}
export -f composer_pre_setup

# @noargs
function composer_setup() {
# COMPOSER

export COMPOSER_ALLOW_SUPERUSER=1
export COMPOSER_NO_INTERACTION=1
export COMPOSER_RUNTIME_ENV="vagrant"

vvv_info " * Checking if Composer is installed"
vvv_info " * [Composer]: Checking if Composer is installed"
if ! command -v composer &> /dev/null; then
vvv_info " * Installing Composer..."
vvv_info " * [Composer]: Running Composer Installer..."
curl -sS "https://getcomposer.org/installer" | php
chmod +x "composer.phar"
chown -R vagrant:www-data /usr/local/bin
mv "composer.phar" "/usr/local/bin/composer"
vvv_success " * Composer installer steps completed"
if [ -f composer.phar ]; then
vvv_info " * [Composer]: Setting ownership and executable bit of composer..."
chmod +x "composer.phar"
chown -R vagrant:www-data /usr/local/bin
vvv_info " * [Composer]: Moving composer into place..."
if mv -f "composer.phar" "/usr/local/bin/composer"; then
vvv_success " * [Composer]: Installed to /usr/local/bin"
else
vvv_error " ! [Composer]: Moving composer.phar to /usr/local/bin/composer did not succeed"
return 1
fi
else
vvv_error " ! [Composer]: Expected to find a composer.phar after running composer installer, but none was found"
return 1
fi
else
vvv_info " * [Composer]: Already installed"
fi

vvv_info " * Making sure the Composer cache is not owned by root"
vvv_info " * [Composer]: Making sure the Composer cache is not owned by root"
COMPOSER_DATA_DIR=$(composer config -g data-dir)
mkdir -p "${COMPOSER_DATA_DIR}"/cache
mkdir -p /root/.local/share/composer
chown -R vagrant:www-data "${COMPOSER_DATA_DIR}"
chown -R vagrant:www-data /root/.local/share/composer

vvv_info " * Checking for GitHub tokens"
vvv_info " * [Composer]: Checking for GitHub tokens"
if github_token=$(shyaml get-value -q "general.github_token" < "${VVV_CONFIG}"); then
vvv_info " * A personal GitHub token was found, configuring Composer"
vvv_info " * [Composer]: A personal GitHub token was found, configuring Composer"
rm /srv/provision/github.token
echo "$github_token" >> /srv/provision/github.token
echo "${github_token}" >> /srv/provision/github.token
ghtoken=$(cat /srv/provision/github.token)
noroot composer config --global github-oauth.github.com "$ghtoken"
vvv_success " * Your personal GitHub token is set for Composer."
vvv_success " * [Composer]: Your personal GitHub token is set for Composer."
fi

# Update both Composer and any global packages. Updates to Composer are direct from
# the master branch on its GitHub repository.
vvv_info " * Checking for Composer updates"
vvv_info " * [Composer]: Checking for Composer updates"
if ! noroot composer --version --no-ansi | grep 'Composer version'; then
vvv_info " * Updating Composer..."
mkdir -p /root/.local/share/composer
vvv_info " * [Composer]: Setting bin dir"
COMPOSER_HOME="${COMPOSER_DATA_DIR}" noroot composer --no-ansi global config bin-dir /usr/local/bin
vvv_info " * [Composer]: Updating Composer"
COMPOSER_HOME="${COMPOSER_DATA_DIR}" noroot composer --no-ansi self-update --2 --stable --no-progress --no-interaction
vvv_info " * Making sure the PHPUnit 7.5 package is available..."
vvv_info " * [Composer]: Making sure the PHPUnit ^7.5 package is available..."
COMPOSER_HOME="${COMPOSER_DATA_DIR}" noroot composer --no-ansi global require --prefer-dist --no-update --no-progress --no-interaction phpunit/phpunit:^7.5
fi

if [ -f "${COMPOSER_DATA_DIR}"/composer.json ]; then
vvv_info " * Updating global Composer packages..."
if [ -f "${COMPOSER_DATA_DIR}/composer.json" ]; then
vvv_info " * [Composer]: Updating global Composer packages..."
COMPOSER_HOME="${COMPOSER_DATA_DIR}" noroot composer --no-ansi global update --no-progress --no-interaction
vvv_success " * Global Composer package update completed"
vvv_success " * [Composer]: Global Composer package update completed"
fi

vvv_success " * [Composer]: Main tasks completed, running after_composer hook"

vvv_hook after_composer
}
export -f composer_setup

vvv_add_hook tools_pre_setup composer_pre_setup
vvv_add_hook tools_setup composer_setup
45 changes: 45 additions & 0 deletions provision/core/env/homedir/.bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,48 @@ if [ -n "$BASH_VERSION" ]; then
. "$HOME/.bash_prompt"
fi
fi

cdnvm() {
command cd "$@";
nvm_path=$(nvm_find_up .nvmrc | tr -d '\n')

# If there are no .nvmrc file, use the default nvm version
if [[ ! $nvm_path = *[^[:space:]]* ]]; then

declare default_version;
default_version=$(nvm version default);

# If there is no default version, set it to `node`
# This will use the latest version on your machine
if [[ $default_version == "N/A" ]]; then
nvm alias default node;
default_version=$(nvm version default);
fi

# If the current version is not the default version, set it to use the default version
if [[ $(nvm current) != "$default_version" ]]; then
nvm use default;
fi

elif [[ -s $nvm_path/.nvmrc && -r $nvm_path/.nvmrc ]]; then
declare nvm_version
nvm_version=$(<"$nvm_path"/.nvmrc)

declare locally_resolved_nvm_version
# `nvm ls` will check all locally-available versions
# If there are multiple matching versions, take the latest one
# Remove the `->` and `*` characters and spaces
# `locally_resolved_nvm_version` will be `N/A` if no local versions are found
locally_resolved_nvm_version=$(nvm ls --no-colors "$nvm_version" | tail -1 | tr -d '\->*' | tr -d '[:space:]')

# If it is not already installed, install it
# `nvm install` will implicitly use the newly-installed version
if [[ "$locally_resolved_nvm_version" == "N/A" ]]; then
nvm install "$nvm_version";
elif [[ $(nvm current) != "$locally_resolved_nvm_version" ]]; then
nvm use "$nvm_version";
fi
fi
}
alias cd='cdnvm'
cd "$PWD"
8 changes: 4 additions & 4 deletions provision/core/env/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@ function profile_setup() {
noroot mkdir -p "/home/vagrant/.subversion"
fi

vvv_info " * Copying /srv/provision/core/env/homedir/.subversion/subversion-servers to /home/vagrant/.subversion/servers"
vvv_info " * Copying /srv/provision/core/env/homedir/.subversion/subversion-servers to /home/vagrant/.subversion/servers"
rm -f /home/vagrant/.subversion/servers
noroot cp "/srv/provision/core/env/homedir/.subversion/subversion-servers" "/home/vagrant/.subversion/servers"

vvv_info " * Copying /srv/provision/core/env/homedir/.subversion/subversion-config to /home/vagrant/.subversion/config"
vvv_info " * Copying /srv/provision/core/env/homedir/.subversion/subversion-config to /home/vagrant/.subversion/config"
rm -f /home/vagrant/.subversion/config
noroot cp "/srv/provision/core/env/homedir/.subversion/subversion-config" "/home/vagrant/.subversion/config"

Expand All @@ -107,9 +107,9 @@ function profile_setup() {
fi

if [ -d "/etc/ssh" ]; then
vvv_info " * Copying /srv/provision/core/env/ssh/ssh_known_hosts to /etc/ssh/ssh_known_hosts"
vvv_info " * Copying /srv/provision/core/env/ssh/ssh_known_hosts to /etc/ssh/ssh_known_hosts"
cp -f /srv/provision/core/env/ssh/ssh_known_hosts /etc/ssh/ssh_known_hosts
vvv_info " * Copying /srv/provision/core/env/ssh/sshd_config to /etc/ssh/sshd_config"
vvv_info " * Copying /srv/provision/core/env/ssh/sshd_config to /etc/ssh/sshd_config"
cp -f /srv/provision/core/env/ssh/sshd_config /etc/ssh/sshd_config
vvv_info " * Reloading SSH Daemon"
service ssh reload
Expand Down
Loading

0 comments on commit fabccb8

Please sign in to comment.