-
Notifications
You must be signed in to change notification settings - Fork 243
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented getjobs and added it to ticker. Some more small stuff on ui
- Loading branch information
1 parent
b0c0634
commit d566d6d
Showing
6 changed files
with
151 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package pipeline | ||
|
||
import ( | ||
"github.com/gaia-pipeline/gaia" | ||
"github.com/gaia-pipeline/gaia/plugin" | ||
) | ||
|
||
// setPipelineJobs uses the plugin system to get all | ||
// jobs from the given pipeline. | ||
// This function is blocking and might take some time. | ||
func setPipelineJobs(p *gaia.Pipeline) { | ||
// Create the start command for the pipeline | ||
c := createPipelineCmd(p) | ||
if c == nil { | ||
gaia.Cfg.Logger.Debug("cannot set pipeline jobs", "error", errMissingType.Error(), "pipeline", p) | ||
return | ||
} | ||
|
||
// Create new plugin instance | ||
pC := plugin.NewPlugin(c) | ||
|
||
// Connect to plugin(pipeline) | ||
if err := pC.Connect(); err != nil { | ||
gaia.Cfg.Logger.Debug("cannot connect to pipeline", "error", err.Error(), "pipeline", p) | ||
return | ||
} | ||
defer pC.Close() | ||
|
||
// Get jobs | ||
jobs, err := pC.GetJobs() | ||
if err != nil { | ||
gaia.Cfg.Logger.Debug("cannot get jobs from pipeline", "error", err.Error(), "pipeline", p) | ||
return | ||
} | ||
p.Jobs = jobs | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters