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
5fe23e59
Commit
5fe23e59
authored
Oct 19, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add latest changes from gitlab-org/gitlab@master
parent
ca9530a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
+26
-4
lib/gitlab/ci/pipeline/seed/deployment.rb
lib/gitlab/ci/pipeline/seed/deployment.rb
+1
-1
lib/gitlab/ci/pipeline/seed/environment.rb
lib/gitlab/ci/pipeline/seed/environment.rb
+1
-1
spec/lib/gitlab/ci/pipeline/seed/environment_spec.rb
spec/lib/gitlab/ci/pipeline/seed/environment_spec.rb
+2
-2
spec/services/ci/create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+22
-0
No files found.
lib/gitlab/ci/pipeline/seed/deployment.rb
View file @
5fe23e59
...
...
@@ -22,7 +22,7 @@ module Gitlab
# If there is a validation error on environment creation, such as
# the name contains invalid character, the job will fall back to a
# non-environment job.
return
unless
deployment
.
valid?
&&
deployment
.
environment
.
vali
d?
return
unless
deployment
.
valid?
&&
deployment
.
environment
.
persiste
d?
deployment
.
cluster_id
=
deployment
.
environment
.
deployment_platform
&
.
cluster_id
...
...
lib/gitlab/ci/pipeline/seed/environment.rb
View file @
5fe23e59
...
...
@@ -12,7 +12,7 @@ module Gitlab
end
def
to_resource
find_environment
||
::
Environment
.
new
(
attributes
)
find_environment
||
::
Environment
.
create
(
attributes
)
end
private
...
...
spec/lib/gitlab/ci/pipeline/seed/environment_spec.rb
View file @
5fe23e59
...
...
@@ -23,9 +23,9 @@ describe Gitlab::Ci::Pipeline::Seed::Environment do
}
end
it
'returns a
n
environment object'
do
it
'returns a
persisted
environment object'
do
expect
(
subject
).
to
be_a
(
Environment
)
expect
(
subject
).
not_
to
be_persisted
expect
(
subject
).
to
be_persisted
expect
(
subject
.
project
).
to
eq
(
project
)
expect
(
subject
.
name
).
to
eq
(
'production'
)
end
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
5fe23e59
...
...
@@ -736,6 +736,28 @@ describe Ci::CreatePipelineService do
end
end
context
'when environment with duplicate names'
do
let
(
:ci_yaml
)
do
{
deploy:
{
environment:
{
name:
'production'
},
script:
'ls'
},
deploy_2:
{
environment:
{
name:
'production'
},
script:
'ls'
}
}
end
before
do
stub_ci_pipeline_yaml_file
(
YAML
.
dump
(
ci_yaml
))
end
it
'creates a pipeline with the environment'
do
result
=
execute_service
expect
(
result
).
to
be_persisted
expect
(
Environment
.
find_by
(
name:
'production'
)).
to
be_present
expect
(
result
.
builds
.
first
.
deployment
).
to
be_persisted
expect
(
result
.
builds
.
first
.
deployment
.
deployable
).
to
be_a
(
Ci
::
Build
)
end
end
context
'when builds with auto-retries are configured'
do
let
(
:pipeline
)
{
execute_service
}
let
(
:rspec_job
)
{
pipeline
.
builds
.
find_by
(
name:
'rspec'
)
}
...
...
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