Пример #1
0
func (a *apiServer) StartPipelineRun(ctx context.Context, startPipelineRunRequest *pps.StartPipelineRunRequest) (*pps.StartPipelineRunResponse, error) {
	dockerHost := os.Getenv("DOCKER_HOST")
	if dockerHost == "" {
		dockerHost = "unix:///var/run/docker.sock"
	}
	containerClient, err := container.NewDockerClient(
		container.DockerClientOptions{
			Host: dockerHost,
		},
	)
	if err != nil {
		return nil, err
	}
	runner := run.NewRunner(
		source.NewSourcer(),
		graph.NewGrapher(),
		containerClient,
		a.storeClient,
		a.timer,
	)
	runID, err := runner.Start(startPipelineRunRequest.PipelineSource)
	if err != nil {
		return nil, err
	}
	return &pps.StartPipelineRunResponse{
		PipelineRunId: runID,
	}, nil
}
Пример #2
0
func (a *apiServer) StartPipelineRun(ctx context.Context, request *pps.StartPipelineRunRequest) (*google_protobuf.Empty, error) {
	runner := run.NewRunner(
		graph.NewGrapher(),
		a.containerClient,
		a.storeClient,
		a.timer,
	)
	if err := runner.Start(request.PipelineRunId); err != nil {
		return nil, err
	}
	return emptyInstance, nil
}
Пример #3
0
func (a *apiServer) StartPipelineRun(ctx context.Context, startPipelineRunRequest *pps.StartPipelineRunRequest) (*pps.StartPipelineRunResponse, error) {
	runner := run.NewRunner(
		source.NewSourcer(),
		graph.NewGrapher(),
		a.containerClient,
		a.storeClient,
		a.timer,
	)
	runID, err := runner.Start(startPipelineRunRequest.PipelineSource)
	if err != nil {
		return nil, err
	}
	return &pps.StartPipelineRunResponse{
		PipelineRunId: runID,
	}, nil
}