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
5623cb9a
Commit
5623cb9a
authored
Aug 31, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make some methods in CI/CD YAML processor private
parent
2339306d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
27 deletions
+29
-27
lib/ci/gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+29
-27
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
5623cb9a
...
...
@@ -20,17 +20,6 @@ module Ci
raise
ValidationError
,
e
.
message
end
def
jobs_for_ref
(
ref
,
tag
=
false
,
source
=
nil
)
@jobs
.
select
do
|
_
,
job
|
process?
(
job
.
dig
(
:only
,
:refs
),
job
.
dig
(
:except
,
:refs
),
ref
,
tag
,
source
)
end
end
def
jobs_for_stage_and_ref
(
stage
,
ref
,
tag
=
false
,
source
=
nil
)
jobs_for_ref
(
ref
,
tag
,
source
).
select
do
|
_
,
job
|
job
[
:stage
]
==
stage
end
end
def
builds_for_stage_and_ref
(
stage
,
ref
,
tag
=
false
,
source
=
nil
)
jobs_for_stage_and_ref
(
stage
,
ref
,
tag
,
source
).
map
do
|
name
,
_
|
...
...
@@ -38,22 +27,6 @@ module Ci
end
end
def
pipeline_stage_builds
(
stage
,
pipeline
)
builds
=
builds_for_stage_and_ref
(
stage
,
pipeline
.
ref
,
pipeline
.
tag?
,
pipeline
.
source
)
builds
.
select
do
|
build
|
job
=
@jobs
[
build
.
fetch
(
:name
).
to_sym
]
has_kubernetes
=
pipeline
.
has_kubernetes_available?
only_kubernetes
=
job
.
dig
(
:only
,
:kubernetes
)
except_kubernetes
=
job
.
dig
(
:except
,
:kubernetes
)
[
!
only_kubernetes
&&
!
except_kubernetes
,
only_kubernetes
&&
has_kubernetes
,
except_kubernetes
&&
!
has_kubernetes
].
any?
end
end
def
builds
@jobs
.
map
do
|
name
,
_
|
build_attributes
(
name
)
...
...
@@ -110,6 +83,35 @@ module Ci
private
def
pipeline_stage_builds
(
stage
,
pipeline
)
builds
=
builds_for_stage_and_ref
(
stage
,
pipeline
.
ref
,
pipeline
.
tag?
,
pipeline
.
source
)
builds
.
select
do
|
build
|
job
=
@jobs
[
build
.
fetch
(
:name
).
to_sym
]
has_kubernetes
=
pipeline
.
has_kubernetes_available?
only_kubernetes
=
job
.
dig
(
:only
,
:kubernetes
)
except_kubernetes
=
job
.
dig
(
:except
,
:kubernetes
)
[
!
only_kubernetes
&&
!
except_kubernetes
,
only_kubernetes
&&
has_kubernetes
,
except_kubernetes
&&
!
has_kubernetes
].
any?
end
end
def
jobs_for_ref
(
ref
,
tag
=
false
,
source
=
nil
)
@jobs
.
select
do
|
_
,
job
|
process?
(
job
.
dig
(
:only
,
:refs
),
job
.
dig
(
:except
,
:refs
),
ref
,
tag
,
source
)
end
end
def
jobs_for_stage_and_ref
(
stage
,
ref
,
tag
=
false
,
source
=
nil
)
jobs_for_ref
(
ref
,
tag
,
source
).
select
do
|
_
,
job
|
job
[
:stage
]
==
stage
end
end
def
initial_parsing
##
# Global config
...
...
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