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
d16fab6a
Commit
d16fab6a
authored
Dec 01, 2017
by
Shinya Maeda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix all deployment_platform(environment: ???)
parent
9dd4fc2d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
5 deletions
+13
-5
app/controllers/projects/branches_controller.rb
app/controllers/projects/branches_controller.rb
+1
-1
app/helpers/auto_devops_helper.rb
app/helpers/auto_devops_helper.rb
+1
-1
app/models/ci/pipeline.rb
app/models/ci/pipeline.rb
+1
-1
app/models/project.rb
app/models/project.rb
+1
-1
app/views/projects/show.html.haml
app/views/projects/show.html.haml
+1
-1
lib/gitlab/ci/build/policy/kubernetes.rb
lib/gitlab/ci/build/policy/kubernetes.rb
+8
-0
No files found.
app/controllers/projects/branches_controller.rb
View file @
d16fab6a
...
...
@@ -41,7 +41,7 @@ class Projects::BranchesController < Projects::ApplicationController
branch_name
=
sanitize
(
strip_tags
(
params
[
:branch_name
]))
branch_name
=
Addressable
::
URI
.
unescape
(
branch_name
)
redirect_to_autodeploy
=
project
.
empty_repo?
&&
project
.
deployment_platform
(
environment:
??
?)
.
present?
redirect_to_autodeploy
=
project
.
empty_repo?
&&
project
.
deployment_platform
.
present?
result
=
CreateBranchService
.
new
(
project
,
current_user
)
.
execute
(
branch_name
,
ref
)
...
...
app/helpers/auto_devops_helper.rb
View file @
d16fab6a
...
...
@@ -26,7 +26,7 @@ module AutoDevopsHelper
def
auto_devops_warning_message
(
project
)
missing_domain
=
!
project
.
auto_devops
&
.
has_domain?
missing_service
=
!
project
.
deployment_platform
(
environment:
??
?)
&
.
active?
missing_service
=
!
project
.
deployment_platform
&
.
active?
if
missing_service
params
=
{
...
...
app/models/ci/pipeline.rb
View file @
d16fab6a
...
...
@@ -377,7 +377,7 @@ module Ci
end
def
has_kubernetes_active?
project
.
deployment_platform
(
environment:
??
?)
&
.
active?
project
.
deployment_platform
&
.
active?
end
def
has_stage_seeds?
...
...
app/models/project.rb
View file @
d16fab6a
...
...
@@ -906,7 +906,7 @@ class Project < ActiveRecord::Base
end
def
deployment_platform
(
environment:
nil
)
@deployment_platform
||=
clusters
.
where
(
environment_scope:
'*'
).
find_by
(
enabled:
true
)
&
.
platform_kubernetes
@deployment_platform
||=
clusters
.
find_by
(
enabled:
true
)
&
.
platform_kubernetes
@deployment_platform
||=
services
.
where
(
category: :deployment
).
reorder
(
nil
).
find_by
(
active:
true
)
end
...
...
app/views/projects/show.html.haml
View file @
d16fab6a
...
...
@@ -67,7 +67,7 @@
-
if
koding_enabled?
&&
@repository
.
koding_yml
.
blank?
%li
.missing
=
link_to
_
(
'Set up Koding'
),
add_koding_stack_path
(
@project
)
-
if
@repository
.
gitlab_ci_yml
.
blank?
&&
@project
.
deployment_platform
(
environment:
??
?)
.
present?
-
if
@repository
.
gitlab_ci_yml
.
blank?
&&
@project
.
deployment_platform
.
present?
%li
.missing
=
link_to
add_special_file_path
(
@project
,
file_name:
'.gitlab-ci.yml'
,
commit_message:
'Set up auto deploy'
,
branch_name:
'auto-deploy'
,
context:
'autodeploy'
)
do
#{
_
(
'Set up auto deploy'
)
}
...
...
lib/gitlab/ci/build/policy/kubernetes.rb
View file @
d16fab6a
...
...
@@ -9,6 +9,14 @@ module Gitlab
end
end
##
# TODO:
# KubernetesService is being replaced by Platform::Kubernetes.
# The new Platform::Kubernetes belongs to multiple environments in a project,
# which means we should do `project.deployment_platform(environment: job.environment)&.active?`
# to check the activeness of the corresponded Kubernetes instance.
# Currently, `kubernetes: active` keyword is defined as it takes an effect on project-wide,
# At some points, it also makes sense, therefore we need to figure out a better shape.
def
satisfied_by?
(
pipeline
)
pipeline
.
has_kubernetes_active?
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