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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0ab64ac7
Commit
0ab64ac7
authored
Dec 01, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix app/models/environment.rb
parent
b59ff4fe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
app/models/environment.rb
app/models/environment.rb
+7
-3
app/models/project.rb
app/models/project.rb
+1
-1
No files found.
app/models/environment.rb
View file @
0ab64ac7
...
@@ -137,16 +137,20 @@ class Environment < ActiveRecord::Base
...
@@ -137,16 +137,20 @@ class Environment < ActiveRecord::Base
end
end
end
end
def
deployment_platform
project
.
deployment_platform
(
environment:
self
)
end
def
has_terminals?
def
has_terminals?
project
.
deployment_platform
(
environment:
name
)
.
present?
&&
available?
&&
last_deployment
.
present?
deployment_platform
.
present?
&&
available?
&&
last_deployment
.
present?
end
end
def
terminals
def
terminals
project
.
deployment_platform
(
environment:
name
)
.
terminals
(
self
)
if
has_terminals?
deployment_platform
.
terminals
(
self
)
if
has_terminals?
end
end
def
rollout_status
def
rollout_status
project
.
deployment_platform
.
rollout_status
(
self
)
if
has_terminals?
deployment_platform
.
rollout_status
(
self
)
if
has_terminals?
end
end
def
has_metrics?
def
has_metrics?
...
...
app/models/project.rb
View file @
0ab64ac7
...
@@ -905,7 +905,7 @@ class Project < ActiveRecord::Base
...
@@ -905,7 +905,7 @@ class Project < ActiveRecord::Base
@ci_service
||=
ci_services
.
reorder
(
nil
).
find_by
(
active:
true
)
@ci_service
||=
ci_services
.
reorder
(
nil
).
find_by
(
active:
true
)
end
end
def
deployment_platform
def
deployment_platform
(
environment:
nil
)
@deployment_platform
||=
clusters
.
where
(
environment_scope:
'*'
).
find_by
(
enabled:
true
)
&
.
platform_kubernetes
@deployment_platform
||=
clusters
.
where
(
environment_scope:
'*'
).
find_by
(
enabled:
true
)
&
.
platform_kubernetes
@deployment_platform
||=
services
.
where
(
category: :deployment
).
reorder
(
nil
).
find_by
(
active:
true
)
@deployment_platform
||=
services
.
where
(
category: :deployment
).
reorder
(
nil
).
find_by
(
active:
true
)
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