Browse Source

ADD build status with killed

tags/v1.0.0
Jasder 5 years ago
parent
commit
5375c3ec71
3 changed files with 3 additions and 1 deletions
  1. +1
    -1
      README.md
  2. +1
    -0
      app/models/ci/build.rb
  3. +1
    -0
      app/queries/ci/builds/list_query.rb

+ 1
- 1
README.md View File

@@ -2745,7 +2745,7 @@ http://localhost:3000/api/Jason/forge/builds | jq
|repo |是|string |项目identifier | |repo |是|string |项目identifier |
|page |否|string |页数,第几页 | |page |否|string |页数,第几页 |
|limit |否|string |每页多少条数据,默认20条 | |limit |否|string |每页多少条数据,默认20条 |
|search |是|string |构建状态条件过滤; 值说明:pending: 准备中,failure: 构建失败,running: 运行中,error:构建失败(.trustie-pipeline.yml文件错误),success: 构建成功 |
|search |是|string |构建状态条件过滤; 值说明:pending: 准备中,failure: 构建失败,running: 运行中,error:构建失败(.trustie-pipeline.yml文件错误),success: 构建成功,killed: 撤销构建 |


*返回参数说明:* *返回参数说明:*




+ 1
- 0
app/models/ci/build.rb View File

@@ -9,5 +9,6 @@ class Ci::Build < Ci::RemoteBase
scope :running, -> { by_status('running') } scope :running, -> { by_status('running') }
scope :errored, -> { by_status('error') } scope :errored, -> { by_status('error') }
scope :pending, -> { by_status('pending') } scope :pending, -> { by_status('pending') }
scope :killed, -> { by_status('killed') }
scope :by_status, ->(status) { where(build_status: status) } scope :by_status, ->(status) { where(build_status: status) }
end end

+ 1
- 0
app/queries/ci/builds/list_query.rb View File

@@ -20,6 +20,7 @@ class Ci::Builds::ListQuery < ApplicationQuery
when 'error' then scope.errored when 'error' then scope.errored
when 'running' then scope.running when 'running' then scope.running
when 'failure' then scope.failed when 'failure' then scope.failed
when 'killed' then scope.killed
else else
scope scope
end end


Loading…
Cancel
Save