Documentation ¶
Index ¶
- func CreatePipeline(p *gaia.CreatePipeline)
- func DeleteBinary(p gaia.Pipeline) error
- func GetExecPath(p gaia.Pipeline) string
- func GitLSRemote(repo *gaia.GitRepo) error
- func InitTicker()
- func RenameBinary(p gaia.Pipeline, newName string) error
- func UpdateRepository(pipe *gaia.Pipeline) error
- type ActivePipelines
- func (ap *ActivePipelines) Append(p gaia.Pipeline)
- func (ap *ActivePipelines) Contains(n string) bool
- func (ap *ActivePipelines) GetByName(n string) *gaia.Pipeline
- func (ap *ActivePipelines) Iter() <-chan gaia.Pipeline
- func (ap *ActivePipelines) Remove(index int)
- func (ap *ActivePipelines) RemoveDeletedPipelines(existingPipelineNames []string)
- func (ap *ActivePipelines) Replace(p gaia.Pipeline) bool
- func (ap *ActivePipelines) ReplaceByName(n string, p gaia.Pipeline) bool
- func (ap *ActivePipelines) Update(index int, p gaia.Pipeline)
- type BuildPipeline
- type BuildPipelineGolang
- type BuildPipelineJava
- type BuildPipelinePython
- type GithubClient
- type GithubRepoService
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 ¶ added in v0.2.1
DeleteBinary deletes the binary for the given pipeline.
func GetExecPath ¶ added in v0.2.1
GetExecPath returns the path to the executable for the given pipeline.
func GitLSRemote ¶
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 ¶ added in v0.2.1
RenameBinary renames the binary file for the given pipeline.
func UpdateRepository ¶ added in v0.2.1
UpdateRepository takes a git type repository and updates it by pulling in new code if it's available.
Types ¶
type ActivePipelines ¶
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 ¶ added in v0.2.1
func (ap *ActivePipelines) Remove(index int)
Remove removes a pipeline at the given index from ActivePipelines.
func (*ActivePipelines) RemoveDeletedPipelines ¶ added in v0.2.1
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 ¶ added in v0.2.1
func (ap *ActivePipelines) ReplaceByName(n string, p gaia.Pipeline) bool
ReplaceByName replaces the pipeline that has the given name 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 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 ¶ added in v0.2.1
func (b *BuildPipelineGolang) SavePipeline(p *gaia.Pipeline) error
SavePipeline saves the current pipeline configuration.
type BuildPipelineJava ¶ added in v0.2.1
type BuildPipelineJava struct {
Type gaia.PipelineType
}
BuildPipelineJava is the real implementation of BuildPipeline for java
func (*BuildPipelineJava) CopyBinary ¶ added in v0.2.1
func (b *BuildPipelineJava) CopyBinary(p *gaia.CreatePipeline) error
CopyBinary copies the final compiled archive to the destination folder.
func (*BuildPipelineJava) ExecuteBuild ¶ added in v0.2.1
func (b *BuildPipelineJava) ExecuteBuild(p *gaia.CreatePipeline) error
ExecuteBuild executes the java build process
func (*BuildPipelineJava) PrepareEnvironment ¶ added in v0.2.1
func (b *BuildPipelineJava) PrepareEnvironment(p *gaia.CreatePipeline) error
PrepareEnvironment prepares the environment before we start the build process.
func (*BuildPipelineJava) SavePipeline ¶ added in v0.2.1
func (b *BuildPipelineJava) SavePipeline(p *gaia.Pipeline) error
SavePipeline saves the current pipeline configuration.
type BuildPipelinePython ¶ added in v0.2.1
type BuildPipelinePython struct {
Type gaia.PipelineType
}
BuildPipelinePython is the real implementation of BuildPipeline for python
func (*BuildPipelinePython) CopyBinary ¶ added in v0.2.1
func (b *BuildPipelinePython) CopyBinary(p *gaia.CreatePipeline) error
CopyBinary copies the final compiled archive to the destination folder.
func (*BuildPipelinePython) ExecuteBuild ¶ added in v0.2.1
func (b *BuildPipelinePython) ExecuteBuild(p *gaia.CreatePipeline) error
ExecuteBuild executes the python build process
func (*BuildPipelinePython) PrepareEnvironment ¶ added in v0.2.1
func (b *BuildPipelinePython) PrepareEnvironment(p *gaia.CreatePipeline) error
PrepareEnvironment prepares the environment before we start the build process.
func (*BuildPipelinePython) SavePipeline ¶ added in v0.2.1
func (b *BuildPipelinePython) SavePipeline(p *gaia.Pipeline) error
SavePipeline saves the current pipeline configuration.
type GithubClient ¶ added in v0.2.1
type GithubClient struct { Repositories GithubRepoService *github.Client }
GithubClient is a client that has the ability to replace the actual git client.
func NewGithubClient ¶ added in v0.2.1
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.