func newBuildPipeline(t gaia.PipelineType) BuildPipeline {
	var bP BuildPipeline
	switch t {
	case gaia.PTypeGolang:
		bP = &BuildPipelineGolang{
			Type: t,
		}
	case gaia.PTypeJava:
		bP = &BuildPipelineJava{
			Type: t,
		}
	case gaia.PTypePython:
		bP = &BuildPipelinePython{
			Type: t,
		}
	case gaia.PTypeCpp:
		bP = &BuildPipelineCpp{
			Type: t,
		}
	case gaia.PTypeRuby:
		bP = &BuildPipelineRuby{
			Type: t,
		}
	case gaia.PTypeNodeJS:
		bP = &BuildPipelineNodeJS{
			Type: t,
		}
	}
	return bP
}
newBuildPipeline creates a new build pipeline for the given
pipeline type.
package pipeline
import (
	"context"
	"errors"
	"fmt"
	"os"
	"os/exec"
	"path/filepath"
	"sync"
	"time"
	"github.com/gaia-pipeline/gaia/helper/pipelinehelper"
	"github.com/gaia-pipeline/gaia"
)
type BuildPipeline interface {
	PrepareEnvironment(*gaia.CreatePipeline) error
	ExecuteBuild(*gaia.CreatePipeline) error
	CopyBinary(*gaia.CreatePipeline) error
	SavePipeline(*gaia.Pipeline) error
}
type ActivePipelines struct {
	sync.RWMutex
	Pipelines []gaia.Pipeline
}
const (
	maxTimeoutMinutes = 60
	typeDelimiter = "_"
)
var (
	GlobalActivePipelines *ActivePipelines
	errMissingType = errors.New("couldn't find pipeline type definition")
)
var execCommandContext = exec.CommandContext