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
db9c03bf
Commit
db9c03bf
authored
Oct 17, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add environment stop action [ci skip]
parent
40528a13
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
12 deletions
+11
-12
app/controllers/projects/environments_controller.rb
app/controllers/projects/environments_controller.rb
+5
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-0
app/models/ci/build.rb
app/models/ci/build.rb
+0
-10
config/routes/project.rb
config/routes/project.rb
+5
-1
No files found.
app/controllers/projects/environments_controller.rb
View file @
db9c03bf
...
...
@@ -2,7 +2,7 @@ class Projects::EnvironmentsController < Projects::ApplicationController
layout
'project'
before_action
:authorize_read_environment!
before_action
:authorize_create_environment!
,
only:
[
:new
,
:create
]
before_action
:authorize_update_environment!
,
only:
[
:edit
,
:update
,
:destroy
]
before_action
:authorize_update_environment!
,
only:
[
:edit
,
:update
,
:
stop
,
:
destroy
]
before_action
:environment
,
only:
[
:show
,
:edit
,
:update
,
:destroy
]
def
index
...
...
@@ -44,6 +44,10 @@ class Projects::EnvironmentsController < Projects::ApplicationController
end
end
def
stop
end
def
destroy
if
@environment
.
destroy
flash
[
:notice
]
=
'Environment was successfully removed.'
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
db9c03bf
...
...
@@ -416,6 +416,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
id:
environment
.
id
,
name:
environment
.
name
,
url:
namespace_project_environment_path
(
project
.
namespace
,
project
,
environment
),
stop_url:
(
stop_namespace_project_environment_path
(
project
.
namespace
,
project
,
environment
)
if
environment
.
closeable?
),
external_url:
environment
.
external_url
,
external_url_formatted:
environment
.
formatted_external_url
,
deployed_at:
deployment
.
try
(
:created_at
),
...
...
app/models/ci/build.rb
View file @
db9c03bf
...
...
@@ -125,16 +125,6 @@ module Ci
end
end
def
play_type
return
nil
unless
playable?
if
close_environment?
:close
else
:play
end
end
def
retryable?
project
.
builds_enabled?
&&
commands
.
present?
&&
complete?
end
...
...
config/routes/project.rb
View file @
db9c03bf
...
...
@@ -318,7 +318,11 @@ resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only:
end
end
resources
:environments
resources
:environments
do
member
do
post
:stop
end
end
resource
:cycle_analytics
,
only:
[
:show
]
...
...
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