Add utility method to generate build

Adds a utility to generate a build, given a buildConfig and modifies the webhook controller to use the new method.
We don't have a pattern for this today - methods that mutate objects (business logic).  Do you have a suggestion for a better path?


> On Nov 21, 2014, at 11:30 AM, Cesar Wong <notifications@github.com> wrote:
> 
> In pkg/build/util/generate.go:
> 
> > @@ -0,0 +1,22 @@
> > +package util
> > +
> > +import (
> > +	kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
> > +	"github.com/openshift/origin/pkg/build/api"
> > +)
> > +
> > +// GenerateBuild creates a new build based on a given BuildConfig. Optionally a SourceRevision for the new
> > +// build can be specified
> > +func GenerateBuild(bc *api.BuildConfig, r *api.SourceRevision) *api.Build {
> It's also meant to be used from command line code, which will come afterwards. As far as the new package goes, wasn't sure where else it would make sense to go, there's no other sort of generic build function location.
> 
> —
> Reply to this email directly or view it on GitHub.
>