class WarpEngine::PipelineService
Triggers and lists the CI runs of a WarpEngine::Pipeline through the CI adapter.
Public Class Methods
Source
# File app/services/warp_engine/pipeline_service.rb, line 5 def initialize(ci: WarpEngine.ci) @ci = ci end
- ci
-
the
CIadapter, by defaultWarpEngine.ci
Public Instance Methods
Source
# File app/services/warp_engine/pipeline_service.rb, line 23 def run(pipeline, number) @ci.run(pipeline.remote_repo_id, number) end
Returns the run number of pipeline.
Source
# File app/services/warp_engine/pipeline_service.rb, line 16 def runs(pipeline, page: 1) runs = @ci.runs(pipeline.remote_repo_id, page: page) refresh_last_run(pipeline, runs.first) if page == 1 runs end
Returns the page page of the runs of pipeline, newest first. The first page also stores the newest run’s status and time on the pipeline.
# File app/services/warp_engine/pipeline_service.rb, line 10 def trigger(pipeline, branch: "main") @ci.trigger(pipeline.remote_repo_id, branch: branch) end
Starts a run of pipeline on branch. Returns what the CI adapter answers.