Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContainerCreater ¶
type ContainerCreater interface { ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error) }
ContainerCreater implementations are used to create containers on a Docker host.
type ExecutionClient ¶
type ExecutionClient interface { ImageLister ImagePuller ContainerCreater ContainerStart(ctx context.Context, containerID string, options types.ContainerStartOptions) error ContainerWait(ctx context.Context, containerID string) (int64, error) ContainerInspect(ctx context.Context, containerID string) (types.ContainerJSON, error) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error CopyToContainer(ctx context.Context, container, path string, content io.Reader, options types.CopyToContainerOptions) error ContainerLogs(ctx context.Context, container string, options types.ContainerLogsOptions) (io.ReadCloser, error) }
ExecutionClient implementations are used to execute pipelines.
type ImageLister ¶
type ImageLister interface {
ImageList(ctx context.Context, options types.ImageListOptions) ([]types.ImageSummary, error)
}
ImageLister implementations can be used to list available images on a Docker host.
type ImagePuller ¶
type ImagePuller interface {
ImagePull(ctx context.Context, imageName string, options types.ImagePullOptions) (io.ReadCloser, error)
}
ImagePuller implementations are used to pull Docker images to a Docker host.
type PersistClient ¶
type PersistClient interface { CreateOutputWriter(projectName string, projectOwner string, commitID string, job string) (func(string, string) (int64, error), int64, error) UpdateJobStatus(jobID int64, status persist.JobStatus, extra string) error }
PersistClient implementations provide a functions that are used to persist job data to a datastore.
type Pipeline ¶
Pipeline contains an image name, and an array containing commands that are executed when the pipeline is executed. When the pipeline is executed, the script array will be concatenated as a single script, of which every command needs to return 0 for the script to pass as successful.
func ParseConfig ¶
ParseConfig deserializes .octorunner.y[a]ml files contained in code repositories. See https://github.com/boyvanduuren/octorunner#adding-a-test-to-your-repository.
func (Pipeline) Execute ¶
func (c Pipeline) Execute(ctx context.Context, cli ExecutionClient, persistClient PersistClient) (int, error)
Execute a pipeline, and return the exit code of its script.