Support multiple php versions through vvv-config.yml & utilities #1055

Merged
merged 9 commits into from Dec 15, 2016

Projects

None yet

2 participants

@LoreleiAurora
Member
LoreleiAurora commented Dec 15, 2016 edited

This adds an additional optional variable of upstream to vvv-config.yml to allow you to set the nginx upstream.
It also switches xDebug from source to the PPA as this is compatible with multiple PHP versions.

An example config for testing:

---
sites:
  wordpress-default:
    repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
    nginx_upstream: php71
    hosts:
      - local.wordpress.dev

  wordpress-develop:
    repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-develop.git
    nginx_upstream: php56
    hosts:
      - src.wordpress-develop.dev
      - build.wordpress-develop.dev

  wordpress-trunk:
    repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-trunk.git
    hosts:
      - local.wordpress-trunk.dev

utilities:
  core:
    - memcached-admin
    - opcache-status
    - phpmyadmin
    - webgrind
    - php56
    - php71

Requires Varying-Vagrant-Vagrants/vvv-utilities#3 to stop my custom repo being needed.

@LoreleiAurora LoreleiAurora referenced this pull request in Varying-Vagrant-Vagrants/vvv-utilities Dec 15, 2016
Merged

Add PHP5.6 && PHP7.1 #3

@LoreleiAurora LoreleiAurora added this to the 2.0.0 milestone Dec 15, 2016
@jeremyfelt

This is pretty slick! I left a couple comments inline. We should also update at least the wordpress-develop repository with the new nginx template variables, even if they end up being the default settings. This should help as a guide.

Vagrantfile
@@ -48,6 +48,7 @@ vvv_config['sites'].each do |site, args|
defaults['branch'] = 'master'
defaults['skip_provisioning'] = false
defaults['allow_customfile'] = false
+ defaults['upstream'] = 'php'
@jeremyfelt
jeremyfelt Dec 15, 2016 Member

How about nginx_upstream or phpfpm_upstream? I doubt we'll ever use "upstream" elsewhere, but it may make it more clear.

@LoreleiAurora
LoreleiAurora Dec 15, 2016 Member

I decided on upstream instead of php_version as i realised it could be used for so much more than PHP, just as a test i have already run it with Node & Python upstreams.

@jeremyfelt
jeremyfelt Dec 15, 2016 Member

Good point, using php here doesn't make sense.

I'm still going to be a pain. Let's do nginx_upstream. I think that clarifies the intent of the config. ๐Ÿ˜„

config/nginx-config/nginx.conf
}
+ include /etc/nginx/upstreams/*.conf;
@jeremyfelt
jeremyfelt Dec 15, 2016 Member

Looks like spacing may be off just a bit in these lines.

@LoreleiAurora
LoreleiAurora Dec 15, 2016 Member

Fixed, my IDE had used tabs instead of spaces ๐Ÿ™„

@jeremyfelt
Member

No reason to keep this waiting. I'll have time to do some more testing this weekend, but I'd like to get this in earlier than later. Thanks @LoreleiAurora!

@jeremyfelt jeremyfelt merged commit f38b82a into Varying-Vagrant-Vagrants:develop Dec 15, 2016
@LoreleiAurora LoreleiAurora deleted the LoreleiAurora:multi-php branch Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment