silverstripe/deploynaut — pull request #60 by sminnee (2014-10-11 03:42:36+00:00)
Title: Separate package generation

This first cut includes an implementation, SimplePackageGenerator, that will run a pre-defined build script locally. Other implementations, that execute a docker container and/or pull a build from a CI server, should be able to implemented.

The package generator is linked into the top-level deployment system; it is called by the CapistranoDeploymentBackend, and inserted into it via Injector configuration. Other deployment backends should be able to also use it, using the code change in CapistranoDeploymentBackend as a guide.

Not yet implemented, but probably helpful, would be some code that lets users edit the BuildScript value on the environment configuration in the UI. Right now, I haven't implemented a CapistranoPackageGenerator that would tie into the Capistrano code to use its build_script. There were two reasons for this:

* The Capistrano code for this is pretty convoluted and I couldn't work out how to do it.
* I'm not convinced that increasing the level of dependence on Capistrano—especially on Capistrano 2—is a good thing, and getting this kind of code working requires tapping into internals that are probably version-specific.

This could also, **cough**, use some tests. However, before going too far with that I wanted to get some confirmation that we're happy with the architecture.

Feedback welcome! (esp. from @ss23 @tractorcow @stojg)