Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
2dd7339c
Commit
2dd7339c
authored
Oct 04, 2018
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add scheduled actions in deployment entity
parent
d3b9e4ef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
app/models/ci/build.rb
app/models/ci/build.rb
+5
-1
app/models/deployment.rb
app/models/deployment.rb
+5
-1
app/serializers/deployment_entity.rb
app/serializers/deployment_entity.rb
+1
-0
No files found.
app/models/ci/build.rb
View file @
2dd7339c
...
@@ -245,10 +245,14 @@ module Ci
...
@@ -245,10 +245,14 @@ module Ci
.
fabricate!
.
fabricate!
end
end
def
other_actions
def
other_
manual_
actions
pipeline
.
manual_actions
.
where
.
not
(
name:
name
)
pipeline
.
manual_actions
.
where
.
not
(
name:
name
)
end
end
def
other_scheduled_actions
pipeline
.
scheduled_actions
.
where
.
not
(
name:
name
)
end
def
pages_generator?
def
pages_generator?
Gitlab
.
config
.
pages
.
enabled
&&
Gitlab
.
config
.
pages
.
enabled
&&
self
.
name
==
'pages'
self
.
name
==
'pages'
...
...
app/models/deployment.rb
View file @
2dd7339c
...
@@ -44,7 +44,11 @@ class Deployment < ActiveRecord::Base
...
@@ -44,7 +44,11 @@ class Deployment < ActiveRecord::Base
end
end
def
manual_actions
def
manual_actions
@manual_actions
||=
deployable
.
try
(
:other_actions
)
@manual_actions
||=
deployable
.
try
(
:other_manual_actions
)
end
def
scheduled_actions
@scheduled_actions
||=
deployable
.
try
(
:other_scheduled_actions
)
end
end
def
includes_commit?
(
commit
)
def
includes_commit?
(
commit
)
...
...
app/serializers/deployment_entity.rb
View file @
2dd7339c
...
@@ -25,4 +25,5 @@ class DeploymentEntity < Grape::Entity
...
@@ -25,4 +25,5 @@ class DeploymentEntity < Grape::Entity
expose
:commit
,
using:
CommitEntity
expose
:commit
,
using:
CommitEntity
expose
:deployable
,
using:
JobEntity
expose
:deployable
,
using:
JobEntity
expose
:manual_actions
,
using:
JobEntity
expose
:manual_actions
,
using:
JobEntity
expose
:scheduled_actions
,
using:
JobEntity
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