This repository was archived by the owner on Jan 10, 2026. It is now read-only.
Description type Argument struct {
Description string `json:"desc,omitempty"`
Type string `json:"type,omitempty"`
Key string `json:"key,omitempty"`
Value string `json:"value,omitempty"`
}
func (pp * PipelineProvider ) PipelineStart (c echo.Context ) error {
pipelineIDStr := c .Param ("pipelineid" )
// Look for arguments.
// We do not check for errors here cause arguments are optional.
var args []* gaia.Argument
_ = c .Bind (& args )
// Convert string to int because id is int
pipelineID , err := strconv .Atoi (pipelineIDStr )
if err != nil {
return c .String (http .StatusBadRequest , errInvalidPipelineID .Error ())
}
// Look up pipeline for the given id
var foundPipeline gaia.Pipeline
for _ , p := range pipeline .GlobalActivePipelines .GetAll () {
if p .ID == pipelineID {
foundPipeline = p
break
}
}
// Overwrite docker setting
for _ , a := range args {
if a .Key == "docker" {
foundPipeline .Docker = a .Value == "1"
}
}
if foundPipeline .Name != "" {
pipelineRun , err := pp .deps .Scheduler .SchedulePipeline (& foundPipeline , gaia .StartReasonManual , args )
if err != nil {
return c .String (http .StatusBadRequest , err .Error ())
} else if pipelineRun != nil {
return c .JSON (http .StatusCreated , pipelineRun )
}
}
// Pipeline not found
return c .String (http .StatusNotFound , errPipelineNotFound .Error ())
}
if bind with []*gaia.Argument can not pass argument with boolean value, the Argument value is type of string
Reactions are currently unavailable
if bind with []*gaia.Argument can not pass argument with boolean value, the Argument value is type of string