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.
It's not really a constructor - it's a business logic flow based on domain objects.


> On Nov 21, 2014, at 12:03 PM, 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 {
> I guess it could be a constructor. Although we don't have constructors for API objects anywhere else. If we're going to create a build from a buildConfig in multiple places we should have one way of doing it and that's what this is.
> 
> —
> Reply to this email directly or view it on GitHub.
>