gaia: github.com/gaia-pipeline/gaia/workers/pipeline Index | Files

package pipeline

import "github.com/gaia-pipeline/gaia/workers/pipeline"

Index

Package Files

build_cpp.go build_golang.go build_java.go build_nodejs.go build_python.go build_ruby.go create_pipeline.go git.go pipeline.go ticker.go update_pipeline.go

func CreatePipeline Uses

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 Uses

func DeleteBinary(p gaia.Pipeline) error

DeleteBinary deletes the binary for the given pipeline.

func GetExecPath Uses

func GetExecPath(p gaia.Pipeline) string

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

func GitLSRemote Uses

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 Uses

func InitTicker()

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

func RenameBinary Uses

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

RenameBinary renames the binary file for the given pipeline.

func StartPoller Uses

func StartPoller() error

StartPoller starts the poller if it's not already running.

func StopPoller Uses

func StopPoller() error

StopPoller sends a done signal to the polling timer if it's running.

func UpdateRepository Uses

func UpdateRepository(pipe *gaia.Pipeline) error

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

func ValidatePipelineName Uses

func ValidatePipelineName(pName string) error

ValidatePipelineName validates a given pipeline name and returns the correct error back.

type ActivePipelines Uses

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 Uses

func NewActivePipelines() *ActivePipelines

NewActivePipelines creates a new instance of ActivePipelines

func (*ActivePipelines) Append Uses

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

Append appends a new pipeline to ActivePipelines.

func (*ActivePipelines) Contains Uses

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) GetAll Uses

func (ap *ActivePipelines) GetAll() []gaia.Pipeline

GetAll iterates over the pipelines in the concurrent slice.

func (*ActivePipelines) GetByName Uses

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

GetByName looks up the pipeline by the given name.

func (*ActivePipelines) Remove Uses

func (ap *ActivePipelines) Remove(index int)

Remove removes a pipeline at the given index from ActivePipelines.

func (*ActivePipelines) RemoveDeletedPipelines Uses

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 Uses

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 Uses

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 Uses

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

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

type BuildPipeline Uses

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 Uses

type BuildPipelineCpp struct {
    Type gaia.PipelineType
}

BuildPipelineCpp is the real implementation of BuildPipeline for C++

func (*BuildPipelineCpp) CopyBinary Uses

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

CopyBinary copies the final compiled binary to the destination folder.

func (*BuildPipelineCpp) ExecuteBuild Uses

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

ExecuteBuild executes the c++ build process

func (*BuildPipelineCpp) PrepareEnvironment Uses

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

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelineCpp) SavePipeline Uses

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

SavePipeline saves the current pipeline configuration.

type BuildPipelineGolang Uses

type BuildPipelineGolang struct {
    Type gaia.PipelineType
}

BuildPipelineGolang is the real implementation of BuildPipeline for golang

func (*BuildPipelineGolang) CopyBinary Uses

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

CopyBinary copies the final compiled archive to the destination folder.

func (*BuildPipelineGolang) ExecuteBuild Uses

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

ExecuteBuild executes the golang build process

func (*BuildPipelineGolang) PrepareEnvironment Uses

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

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelineGolang) SavePipeline Uses

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

SavePipeline saves the current pipeline configuration.

type BuildPipelineJava Uses

type BuildPipelineJava struct {
    Type gaia.PipelineType
}

BuildPipelineJava is the real implementation of BuildPipeline for java

func (*BuildPipelineJava) CopyBinary Uses

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

CopyBinary copies the final compiled archive to the destination folder.

func (*BuildPipelineJava) ExecuteBuild Uses

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

ExecuteBuild executes the java build process

func (*BuildPipelineJava) PrepareEnvironment Uses

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

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelineJava) SavePipeline Uses

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

SavePipeline saves the current pipeline configuration.

type BuildPipelineNodeJS Uses

type BuildPipelineNodeJS struct {
    Type gaia.PipelineType
}

BuildPipelineNodeJS is the real implementation of BuildPipeline for NodeJS

func (*BuildPipelineNodeJS) CopyBinary Uses

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

CopyBinary copies the final compiled binary to the destination folder.

func (*BuildPipelineNodeJS) ExecuteBuild Uses

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

ExecuteBuild executes the NodeJS build process

func (*BuildPipelineNodeJS) PrepareEnvironment Uses

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

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelineNodeJS) SavePipeline Uses

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

SavePipeline saves the current pipeline configuration.

type BuildPipelinePython Uses

type BuildPipelinePython struct {
    Type gaia.PipelineType
}

BuildPipelinePython is the real implementation of BuildPipeline for python

func (*BuildPipelinePython) CopyBinary Uses

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

CopyBinary copies the final compiled archive to the destination folder.

func (*BuildPipelinePython) ExecuteBuild Uses

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

ExecuteBuild executes the python build process

func (*BuildPipelinePython) PrepareEnvironment Uses

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

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelinePython) SavePipeline Uses

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

SavePipeline saves the current pipeline configuration.

type BuildPipelineRuby Uses

type BuildPipelineRuby struct {
    Type gaia.PipelineType
}

BuildPipelineRuby is the real implementation of BuildPipeline for Ruby

func (*BuildPipelineRuby) CopyBinary Uses

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

CopyBinary copies the final compiled binary to the destination folder.

func (*BuildPipelineRuby) ExecuteBuild Uses

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

ExecuteBuild executes the ruby build process

func (*BuildPipelineRuby) PrepareEnvironment Uses

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

PrepareEnvironment prepares the environment before we start the build process.

func (*BuildPipelineRuby) SavePipeline Uses

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

SavePipeline saves the current pipeline configuration.

type GithubClient Uses

type GithubClient struct {
    Repositories GithubRepoService
    *github.Client
}

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

func NewGithubClient Uses

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 Uses

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.

Package pipeline imports 33 packages (graph) and is imported by 3 packages. Updated 2019-07-30. Refresh now. Tools for package owners.