BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
eedf43d6
Commit
eedf43d6
authored
Oct 11, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set pipeline config source attribute in a build step
parent
54f490a4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
2 deletions
+11
-2
build.rb
lib/gitlab/ci/pipeline/chain/build.rb
+2
-0
build_spec.rb
spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
+1
-1
create_pipeline_service_spec.rb
spec/services/ci/create_pipeline_service_spec.rb
+2
-1
stub_gitlab_calls.rb
spec/support/stub_gitlab_calls.rb
+6
-0
No files found.
lib/gitlab/ci/pipeline/chain/build.rb
View file @
eedf43d6
...
@@ -18,6 +18,8 @@ module Gitlab
...
@@ -18,6 +18,8 @@ module Gitlab
pipeline_schedule:
@command
.
schedule
,
pipeline_schedule:
@command
.
schedule
,
protected:
protected_ref?
protected:
protected_ref?
)
)
@pipeline
.
set_config_source
end
end
def
break?
def
break?
...
...
spec/lib/gitlab/ci/pipeline/chain/build_spec.rb
View file @
eedf43d6
...
@@ -20,7 +20,7 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
...
@@ -20,7 +20,7 @@ describe Gitlab::Ci::Pipeline::Chain::Build do
let
(
:step
)
{
described_class
.
new
(
pipeline
,
command
)
}
let
(
:step
)
{
described_class
.
new
(
pipeline
,
command
)
}
before
do
before
do
stub_
ci_pipeline_to_return_yaml_file
stub_
repository_ci_yaml_file
(
sha:
anything
)
step
.
perform!
step
.
perform!
end
end
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
eedf43d6
...
@@ -8,7 +8,7 @@ describe Ci::CreatePipelineService do
...
@@ -8,7 +8,7 @@ describe Ci::CreatePipelineService do
let
(
:ref_name
)
{
'refs/heads/master'
}
let
(
:ref_name
)
{
'refs/heads/master'
}
before
do
before
do
stub_
ci_pipeline_to_return_yaml_file
stub_
repository_ci_yaml_file
(
sha:
anything
)
end
end
describe
'#execute'
do
describe
'#execute'
do
...
@@ -44,6 +44,7 @@ describe Ci::CreatePipelineService do
...
@@ -44,6 +44,7 @@ describe Ci::CreatePipelineService do
expect
(
pipeline
).
to
eq
(
project
.
pipelines
.
last
)
expect
(
pipeline
).
to
eq
(
project
.
pipelines
.
last
)
expect
(
pipeline
).
to
have_attributes
(
user:
user
)
expect
(
pipeline
).
to
have_attributes
(
user:
user
)
expect
(
pipeline
).
to
have_attributes
(
status:
'pending'
)
expect
(
pipeline
).
to
have_attributes
(
status:
'pending'
)
expect
(
pipeline
.
repository_source?
).
to
be
true
expect
(
pipeline
.
builds
.
first
).
to
be_kind_of
(
Ci
::
Build
)
expect
(
pipeline
.
builds
.
first
).
to
be_kind_of
(
Ci
::
Build
)
end
end
...
...
spec/support/stub_gitlab_calls.rb
View file @
eedf43d6
...
@@ -21,6 +21,12 @@ module StubGitlabCalls
...
@@ -21,6 +21,12 @@ module StubGitlabCalls
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:ci_yaml_file
)
{
ci_yaml
}
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:ci_yaml_file
)
{
ci_yaml
}
end
end
def
stub_repository_ci_yaml_file
(
sha
:,
path:
'.gitlab-ci.yml'
)
allow_any_instance_of
(
Repository
)
.
to
receive
(
:gitlab_ci_yml_for
).
with
(
sha
,
path
)
.
and_return
(
gitlab_ci_yaml
)
end
def
stub_ci_builds_disabled
def
stub_ci_builds_disabled
allow_any_instance_of
(
Project
).
to
receive
(
:builds_enabled?
).
and_return
(
false
)
allow_any_instance_of
(
Project
).
to
receive
(
:builds_enabled?
).
and_return
(
false
)
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