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

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

Merged
merged 9 commits into from Dec 15, 2016
Merged

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

merged 9 commits into from Dec 15, 2016

Conversation

LoreleiAurora
Copy link
Contributor

@LoreleiAurora LoreleiAurora commented Dec 15, 2016

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.

Copy link
Member

@jeremyfelt jeremyfelt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@@ -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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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. 😄

}

include /etc/nginx/upstreams/*.conf;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, my IDE had used tabs instead of spaces 🙄

@jeremyfelt
Copy link
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 multi-php branch December 15, 2016 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants