dciy icon indicating copy to clipboard operation
dciy copied to clipboard

[WIP] Include configuration post-build actions.

Open smashwilson opened this issue 10 years ago • 2 comments

Adds a hierarchy of PostBuildAction models that encapsulate different things you can do when your builds succeed or fail. These can be used to automate deployment (#6), publish build status badges (#9), or any number of other useful things. Individual actions can be configured to run on only passing or failing builds, or only when specific branches are involved. To add new ones, we can subclass PostBuildAction and implement an #execute_within method that does whatever it needs to do.

I built this on top of the RSpec PR (#15) so that I could use mocks to spec out the push behavior, so it's got some extraneous stuff in the diff right now.

Left to do:

  • [x] Wait until #15 is merged, or rewrite my specs in Test::Unit :innocent:
  • [x] Execute post-build actions in the Runner.
  • [ ] User interface to do CRUD operations on the post-build actions for a project. I was thinking of adding a section to the "Configure Project" page.
  • [ ] Handle failure somehow! Should a post-build action that fails fail the build? Or should it put the build in some kind of warning state?

smashwilson avatar Sep 21 '13 21:09 smashwilson

Hmmm, should I add a PreBuildAction too, or rename things so we have "hooks" that can run at different phases of the build maybe? I like the symmetry but I can't think of anything else that really needs this that isn't #18. Maybe it would be simpler and more elegant to keep #18 special-cased.

smashwilson avatar Sep 30 '13 23:09 smashwilson

Yeah, I’m leaning on the side of keeping the GitHub commit status API stuff as being a special case for now. It seems simple enough to me (and I imagine will be the main use-case people have for the concept of pre/post build actions anyway) that I think trying to generalise it out seems unnecessary right now.

have "hooks" that can run at different phases of the build

I really like the sound of that idea, but maybe we need something even more general again. Take the whole heroku deploy idea for example. What if you want to re-deploy a branch from DCIY? Do you have to trigger a build for it just so that the PostBuildAction gets triggered? What if you already know that a branch is successful and you just want to click a "Deploy" button to send master or stable or whatever back out onto the staging server you have set up?

Just thinking out aloud here…

cobyism avatar Oct 01 '13 09:10 cobyism