Any build system like Phing (including: make, Grunt, Gulp, SCons, Ant, etc) would be extremely helpful for Panopoly contributors.
Basically, it'd allow contributors to create a configuration file that tells the build system about their environment and their preferences and then run simple commands, like "phing make-profile", "phing install" or "phing test", to easily perform common contributor tasks, as well as do any necessary setup and run dependent tasks when necessary.
For example, let's say you just checked Panopoly out of Git and hadn't done any setup yet. By running "phing test", it would see that you haven't yet built the profile and run "phing make-profile", see that you hadn't yet installed Panopoly and run "phing install" to install a Panopoly site via drush, as well as download Behat and it's dependencies via composer, download and start selenium and finally run the Behat tests.
This would allow contributors to get started really, really quickly without needing to do any of those things manually (or even know how to do those things).
I think Phing (vs Grunt, Gulp, etc) is right choice for a number of reasons:
- It's built on PHP, so if you're running Drupal, you already have it. You don't have to install another tool chain like Node, Python, or Ruby
- It's built on PHP, so to extend it, you write PHP. If you're a Panopoly contributor, you're more likely to know PHP.
- You can install it via composer, which is also how you install Drush, Symfony, Behat and Drupal 8
So, while Phing isn't the new hotness (like Grunt or Gulp) and it uses a Ant-inspired XML files to define targets (ick!), I think it's the right choice for a Panopoly, because our highest priority for this functionality is allowing contributors to start contributing with the lowest amount of friction possible. Yes, "go install Node" is more friction than I want to introduce. :-)
TODO
Switch 'phing' install to composer. The README still suggests installing with pear - this is left over from a much older iteration! We should include a composer.json/lock in Panopoly to install phing and any other build dependencies.Implement 'install' target- Implement 'test' target
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | panopoly-phing-2509166-10.patch | 48.81 KB | dsnopek |
| #9 | panopoly_test-phing-2509166-9.patch | 956 bytes | dsnopek |
Comments
Comment #1
dsnopekHere is my first pass!
This is using some reusable Phing scripts that I've actually been working on for several years (writing and re-writing them) which you can find here:
https://github.com/dsnopek/phing-drupal-distributions
The idea is that they could be used by any distro!
I've been using them with MVPCreator (such that it is) for a while now.
This is far from finished! Before committing, I want to have the following additional targets implemented:
I have lots of other ideas too (and some existing code from previous iterations of this).
Comment #2
dsnopekComment #3
dsnopekAdded TODO of the things I want to do before committing this.
Comment #4
mglamanComposer can be used, just in case someone doesn't have pear on their system, and will require composer anyways for Behat.
Comment #5
dsnopek@mglaman: Yep! That was already in the TODO in the issue summary and actually I implemented it yesterday afternoon:
https://github.com/dsnopek/phing-drupal-distributions/commit/067a664644d...
Here's a new patch with that change in it!
Comment #6
dsnopekHere's a patch that implements the 'install' target.
Comment #7
dsnopekHere is a new patch that almost fully implements the 'test' target. It'll actually work now, but it doesn't write the behat.yml file or process the results in any good sort of way.
Comment #8
dsnopekHere's a patch that fixes the composer.json/lock.
Comment #9
dsnopekHere is the latest version of the profile patch, and a patch for panopoly_test which allows the template to actually be used by Phing. I still need to end-to-end test this with the sprint kit, but this is now in "Needs review" territory.
Comment #10
dsnopekAlright, I think this is the last version of this! This is just some fixes for running Behat tests and adding the 'setup-all' to do all setup upfront.
Comment #11
dsnopekCommitted!