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:

  1. 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
  2. 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.
  3. 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

  1. 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.
  2. Implement 'install' target
  3. Implement 'test' target

Comments

dsnopek’s picture

Status: Active » Needs work
StatusFileSize
new21.21 KB

Here 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:

  • phing install
  • phing test

I have lots of other ideas too (and some existing code from previous iterations of this).

dsnopek’s picture

Issue tags: +sprint
dsnopek’s picture

Issue summary: View changes

Added TODO of the things I want to do before committing this.

mglaman’s picture

+++ b/build/README.md
@@ -0,0 +1,29 @@
+First, you need to install Phing:
+
+    pear channel-discover pear.phing.info
+    pear install phing/phing
+
+Then you need to install VersionControl_Git:
+
+    pear install VersionControl_Git-0.4.4
+

Composer can be used, just in case someone doesn't have pear on their system, and will require composer anyways for Behat.

    "require": {
        "phing/phing": "2.4.13",
        "pear-pear.php.net/VersionControl_Git" : "*"
    },
dsnopek’s picture

StatusFileSize
new29.6 KB

@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!

dsnopek’s picture

Issue summary: View changes
StatusFileSize
new32.4 KB

Here's a patch that implements the 'install' target.

dsnopek’s picture

StatusFileSize
new38.99 KB

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

dsnopek’s picture

StatusFileSize
new47.98 KB

Here's a patch that fixes the composer.json/lock.

dsnopek’s picture

Status: Needs work » Needs review
StatusFileSize
new48.36 KB
new956 bytes

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

dsnopek’s picture

StatusFileSize
new48.81 KB

Alright, 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.

dsnopek’s picture

Status: Needs review » Fixed

Committed!

  • dsnopek committed 66c1c0f on 7.x-1.x
    Issue #2509166 by dsnopek: Add phing-based build system to make it...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.