pipeline

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2018 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePipeline

func CreatePipeline(p *gaia.CreatePipeline)

CreatePipeline is the main function which executes step by step the creation of a plugin. After each step, the status is written to store and can be retrieved via API.

func DeleteBinary

func DeleteBinary(p gaia.Pipeline) error

DeleteBinary deletes the binary for the given pipeline.

func GetExecPath

func GetExecPath(p gaia.Pipeline) string

GetExecPath returns the path to the executable for the given pipeline.

func GitLSRemote

func GitLSRemote(repo *gaia.GitRepo) error

GitLSRemote get remote branches from a git repo without actually cloning the repo. This is great for looking if we have access to this repo.

func InitTicker

func InitTicker()

InitTicker inititates the pipeline ticker. This periodic job will check for new pipelines.

func RenameBinary

func RenameBinary(p gaia.Pipeline, newName string) error

RenameBinary renames the binary file for the given pipeline.

func UpdateRepository

func UpdateRepository(pipe *gaia.Pipeline) error

UpdateRepository takes a git type repository and updates it by pulling in new code if it's available.

Types

type ActivePipelines

type ActivePipelines struct {
	sync.RWMutex

	// All active pipelines
	Pipelines []gaia.Pipeline
}

ActivePipelines holds all active pipelines. ActivePipelines can be safely shared between goroutines.

var (
	// GlobalActivePipelines holds globally all current active pipleines.
	GlobalActivePipelines *ActivePipelines
)

func NewActivePipelines

func NewActivePipelines() *ActivePipelines

NewActivePipelines creates a new instance of ActivePipelines

func (*ActivePipelines) Append

func (ap *ActivePipelines) Append(p gaia.Pipeline)

Append appends a new pipeline to ActivePipelines.

func (*ActivePipelines) Contains

func (ap *ActivePipelines) Contains(n string) bool

Contains checks if the given pipeline name has been already appended to the given ActivePipelines instance.

func (*ActivePipelines) GetByName

func (ap *ActivePipelines) GetByName(n string) *gaia.Pipeline

GetByName looks up the pipeline by the given name.

func (*ActivePipelines) Iter

func (ap *ActivePipelines) Iter() <-chan gaia.Pipeline

Iter iterates over the pipelines in the concurrent slice.

func (*ActivePipelines) Remove

func (ap *ActivePipelines) Remove(index int)

Remove removes a pipeline at the given index from ActivePipelines.

func (*ActivePipelines) RemoveDeletedPipelines

func (ap *ActivePipelines) RemoveDeletedPipelines(existingPipelineNames []string)

RemoveDeletedPipelines removes the pipelines whose names are NOT present in `existingPipelineNames` from the given ActivePipelines instance.

func (*ActivePipelines) Replace

func (ap *ActivePipelines) Replace(p gaia.Pipeline) bool

Replace takes the given pipeline and replaces it in the ActivePipelines slice. Return true when success otherwise false.

func (*ActivePipelines) ReplaceByName

func (ap *ActivePipelines) ReplaceByName(n string, p gaia.Pipeline) bool

ReplaceByName replaces the pipeline that has the given name with the given pipeline.

func (*ActivePipelines) Update

func (ap *ActivePipelines) Update(index int, p gaia.Pipeline)

Update updates a pipeline at the given index with the given pipeline.

type BuildPipeline

type BuildPipeline interface {
	// PrepareEnvironment prepares the environment before we start the
	// build process.
	PrepareEnvironment(*gaia.CreatePipeline) error

	// ExecuteBuild executes the compiler and tracks the status of
	// the compiling process.
	ExecuteBuild(*gaia.CreatePipeline) error

	// CopyBinary copies the result from the compile process
	// to the plugins folder.
	CopyBinary(*gaia.CreatePipeline) error

	// SavePipeline the pipeline in its current format
	SavePipeline(*gaia.Pipeline) error
}

BuildPipeline is the interface for pipelines which are not yet compiled.

type BuildPipelineCpp

type BuildPipelineCpp struct {
	Type gaia.PipelineType
}

BuildPipelineCpp is the real implementation of BuildPipeline for C++

func (*BuildPipelineCpp) CopyBinary

func (b *BuildPipelineCpp) CopyBinary(p *gaia.CreatePipeline) error

CopyBinary copies the final compiled binary to the destination folder.

func (*BuildPipelineCpp) ExecuteBuild

func (b *BuildPipelineCpp) ExecuteBuild(p *gaia.CreatePipeline) error

ExecuteBuild executes the c++ build process

func (*BuildPipelineCpp) PrepareEnvironment

func (b *BuildPipelineCpp) PrepareEnvironment(p *gaia.CreatePipeline) error

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelineCpp) SavePipeline

func (b *BuildPipelineCpp) SavePipeline(p *gaia.Pipeline) error

SavePipeline saves the current pipeline configuration.

type BuildPipelineGolang

type BuildPipelineGolang struct {
	Type gaia.PipelineType
}

BuildPipelineGolang is the real implementation of BuildPipeline for golang

func (*BuildPipelineGolang) CopyBinary

func (b *BuildPipelineGolang) CopyBinary(p *gaia.CreatePipeline) error

CopyBinary copies the final compiled archive to the destination folder.

func (*BuildPipelineGolang) ExecuteBuild

func (b *BuildPipelineGolang) ExecuteBuild(p *gaia.CreatePipeline) error

ExecuteBuild executes the golang build process

func (*BuildPipelineGolang) PrepareEnvironment

func (b *BuildPipelineGolang) PrepareEnvironment(p *gaia.CreatePipeline) error

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelineGolang) SavePipeline

func (b *BuildPipelineGolang) SavePipeline(p *gaia.Pipeline) error

SavePipeline saves the current pipeline configuration.

type BuildPipelineJava

type BuildPipelineJava struct {
	Type gaia.PipelineType
}

BuildPipelineJava is the real implementation of BuildPipeline for java

func (*BuildPipelineJava) CopyBinary

func (b *BuildPipelineJava) CopyBinary(p *gaia.CreatePipeline) error

CopyBinary copies the final compiled archive to the destination folder.

func (*BuildPipelineJava) ExecuteBuild

func (b *BuildPipelineJava) ExecuteBuild(p *gaia.CreatePipeline) error

ExecuteBuild executes the java build process

func (*BuildPipelineJava) PrepareEnvironment

func (b *BuildPipelineJava) PrepareEnvironment(p *gaia.CreatePipeline) error

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelineJava) SavePipeline

func (b *BuildPipelineJava) SavePipeline(p *gaia.Pipeline) error

SavePipeline saves the current pipeline configuration.

type BuildPipelinePython

type BuildPipelinePython struct {
	Type gaia.PipelineType
}

BuildPipelinePython is the real implementation of BuildPipeline for python

func (*BuildPipelinePython) CopyBinary

func (b *BuildPipelinePython) CopyBinary(p *gaia.CreatePipeline) error

CopyBinary copies the final compiled archive to the destination folder.

func (*BuildPipelinePython) ExecuteBuild

func (b *BuildPipelinePython) ExecuteBuild(p *gaia.CreatePipeline) error

ExecuteBuild executes the python build process

func (*BuildPipelinePython) PrepareEnvironment

func (b *BuildPipelinePython) PrepareEnvironment(p *gaia.CreatePipeline) error

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelinePython) SavePipeline

func (b *BuildPipelinePython) SavePipeline(p *gaia.Pipeline) error

SavePipeline saves the current pipeline configuration.

type GithubClient

type GithubClient struct {
	Repositories GithubRepoService
	*github.Client
}

GithubClient is a client that has the ability to replace the actual git client.

func NewGithubClient

func NewGithubClient(httpClient *gohttp.Client, repoMock GithubRepoService) GithubClient

NewGithubClient creates a wrapper around the github client. This is needed in order to decouple gaia from github client to be able to unit test createGithubWebhook and ultimately have the ability to replace github with anything else.

type GithubRepoService

type GithubRepoService interface {
	CreateHook(ctx context.Context, owner, repo string, hook *github.Hook) (*github.Hook, *github.Response, error)
}

GithubRepoService is an interface defining the Wrapper Interface needed to test the github client.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL