BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d47aef58
Commit
d47aef58
authored
Dec 05, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Ci::Status::Stage
parent
2f972ad4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
stage.rb
app/models/ci/stage.rb
+2
-0
common.rb
lib/gitlab/ci/status/stage/common.rb
+24
-0
factory.rb
lib/gitlab/ci/status/stage/factory.rb
+39
-0
No files found.
app/models/ci/stage.rb
View file @
d47aef58
...
@@ -6,6 +6,8 @@ module Ci
...
@@ -6,6 +6,8 @@ module Ci
attr_reader
:pipeline
,
:name
attr_reader
:pipeline
,
:name
delegate
:project
,
to: :pipeline
def
initialize
(
pipeline
,
name:
name
,
status:
nil
)
def
initialize
(
pipeline
,
name:
name
,
status:
nil
)
@pipeline
,
@name
,
@status
=
pipeline
,
name
,
status
@pipeline
,
@name
,
@status
=
pipeline
,
name
,
status
end
end
...
...
lib/gitlab/ci/status/stage/common.rb
0 → 100644
View file @
d47aef58
module
Gitlab
module
Ci
module
Status
module
Stage
module
Common
def
has_details?
true
end
def
details_path
namespace_project_pipeline_path
(
@subject
.
project
.
namespace
,
@subject
.
project
,
@subject
,
anchor:
subject
.
name
)
end
def
has_action?
false
end
end
end
end
end
end
lib/gitlab/ci/status/stage/factory.rb
0 → 100644
View file @
d47aef58
module
Gitlab
module
Ci
module
Status
module
Stage
class
Factory
EXTENDED_STATUSES
=
[]
def
initialize
(
stage
)
@stage
=
stage
@status
=
stage
.
status
||
:created
end
def
fabricate!
if
extended_status
extended_status
.
new
(
core_status
)
else
core_status
end
end
private
def
core_status
Gitlab
::
Ci
::
Status
.
const_get
(
@status
.
capitalize
)
.
new
(
@stage
)
.
extend
(
Status
::
Pipeline
::
Common
)
end
def
extended_status
@extended
||=
EXTENDED_STATUSES
.
find
do
|
status
|
status
.
matches?
(
@stage
)
end
end
end
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment