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
2f96e5d3
Commit
2f96e5d3
authored
Jun 24, 2019
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Populate cluster_id when creating a deployment
parent
525edec7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
4 deletions
+16
-4
app/models/concerns/deployable.rb
app/models/concerns/deployable.rb
+1
-0
changelogs/unreleased/add-clusters-to-deployment.yml
changelogs/unreleased/add-clusters-to-deployment.yml
+5
-0
spec/models/concerns/deployable_spec.rb
spec/models/concerns/deployable_spec.rb
+10
-4
No files found.
app/models/concerns/deployable.rb
View file @
2f96e5d3
...
...
@@ -18,6 +18,7 @@ module Deployable
return
unless
environment
.
persisted?
create_deployment!
(
cluster_id:
environment
.
deployment_platform
&
.
cluster_id
,
project_id:
environment
.
project_id
,
environment:
environment
,
ref:
ref
,
...
...
changelogs/unreleased/add-clusters-to-deployment.yml
0 → 100644
View file @
2f96e5d3
---
title
:
Persist the cluster a deployment was deployed to
merge_request
:
29960
author
:
type
:
fixed
spec/models/concerns/deployable_spec.rb
View file @
2f96e5d3
...
...
@@ -7,10 +7,6 @@ describe Deployable do
let
(
:deployment
)
{
job
.
deployment
}
let
(
:environment
)
{
deployment
&
.
environment
}
before
do
job
.
reload
end
context
'when the deployable object will deploy to production'
do
let!
(
:job
)
{
create
(
:ci_build
,
:start_review_app
)
}
...
...
@@ -26,6 +22,16 @@ describe Deployable do
end
end
context
'when the deployable object will deploy to a cluster'
do
let
(
:project
)
{
create
(
:project
)
}
let!
(
:cluster
)
{
create
(
:cluster
,
:provided_by_user
,
projects:
[
project
])
}
let!
(
:job
)
{
create
(
:ci_build
,
:start_review_app
,
project:
project
)
}
it
'creates a deployment with cluster association'
do
expect
(
deployment
.
cluster
).
to
eq
(
cluster
)
end
end
context
'when the deployable object will stop an environment'
do
let!
(
:job
)
{
create
(
:ci_build
,
:stop_review_app
)
}
...
...
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