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
Show 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
pipeline_schedule:
@command
.
schedule
,
protected:
protected_ref?
)
@pipeline
.
set_config_source
end
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
let
(
:step
)
{
described_class
.
new
(
pipeline
,
command
)
}
before
do
stub_
ci_pipeline_to_return_yaml_file
stub_
repository_ci_yaml_file
(
sha:
anything
)
step
.
perform!
end
...
...
spec/services/ci/create_pipeline_service_spec.rb
View file @
eedf43d6
...
...
@@ -8,7 +8,7 @@ describe Ci::CreatePipelineService do
let
(
:ref_name
)
{
'refs/heads/master'
}
before
do
stub_
ci_pipeline_to_return_yaml_file
stub_
repository_ci_yaml_file
(
sha:
anything
)
end
describe
'#execute'
do
...
...
@@ -44,6 +44,7 @@ describe Ci::CreatePipelineService do
expect
(
pipeline
).
to
eq
(
project
.
pipelines
.
last
)
expect
(
pipeline
).
to
have_attributes
(
user:
user
)
expect
(
pipeline
).
to
have_attributes
(
status:
'pending'
)
expect
(
pipeline
.
repository_source?
).
to
be
true
expect
(
pipeline
.
builds
.
first
).
to
be_kind_of
(
Ci
::
Build
)
end
...
...
spec/support/stub_gitlab_calls.rb
View file @
eedf43d6
...
...
@@ -21,6 +21,12 @@ module StubGitlabCalls
allow_any_instance_of
(
Ci
::
Pipeline
).
to
receive
(
:ci_yaml_file
)
{
ci_yaml
}
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
allow_any_instance_of
(
Project
).
to
receive
(
:builds_enabled?
).
and_return
(
false
)
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