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
Léo-Paul Géneau
gitlab-ce
Commits
e9b42067
Commit
e9b42067
authored
Jul 09, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove CI job stage code from legacy config processor
parent
9edced40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
19 deletions
+9
-19
lib/ci/gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+9
-19
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
e9b42067
...
@@ -57,6 +57,9 @@ module Ci
...
@@ -57,6 +57,9 @@ module Ci
private
private
def
initial_parsing
def
initial_parsing
##
# Global config
#
@before_script
=
@ci_config
.
before_script
@before_script
=
@ci_config
.
before_script
@image
=
@ci_config
.
image
@image
=
@ci_config
.
image
@after_script
=
@ci_config
.
after_script
@after_script
=
@ci_config
.
after_script
...
@@ -65,24 +68,16 @@ module Ci
...
@@ -65,24 +68,16 @@ module Ci
@stages
=
@ci_config
.
stages
@stages
=
@ci_config
.
stages
@cache
=
@ci_config
.
cache
@cache
=
@ci_config
.
cache
@jobs
=
{}
##
# Jobs
@ci_config
.
jobs
.
each
do
|
name
,
param
|
#
add_job
(
name
,
param
)
@jobs
=
@ci_config
.
jobs
end
@jobs
.
each
do
|
name
,
job
|
@jobs
.
each
do
|
name
,
job
|
validate_job!
(
name
,
job
)
validate_job!
(
name
,
job
)
end
end
end
end
def
add_job
(
name
,
job
)
raise
ValidationError
,
"Unknown parameter:
#{
name
}
"
unless
job
.
is_a?
(
Hash
)
&&
job
.
has_key?
(
:script
)
stage
=
job
[
:stage
]
||
job
[
:type
]
||
DEFAULT_STAGE
@jobs
[
name
]
=
{
stage:
stage
}.
merge
(
job
)
end
def
build_job
(
name
,
job
)
def
build_job
(
name
,
job
)
{
{
stage_idx:
@stages
.
index
(
job
[
:stage
]),
stage_idx:
@stages
.
index
(
job
[
:stage
]),
...
@@ -112,12 +107,13 @@ module Ci
...
@@ -112,12 +107,13 @@ module Ci
end
end
def
validate_job!
(
name
,
job
)
def
validate_job!
(
name
,
job
)
raise
ValidationError
,
"Unknown parameter:
#{
name
}
"
unless
job
.
is_a?
(
Hash
)
&&
job
.
has_key?
(
:script
)
validate_job_name!
(
name
)
validate_job_name!
(
name
)
validate_job_keys!
(
name
,
job
)
validate_job_keys!
(
name
,
job
)
validate_job_types!
(
name
,
job
)
validate_job_types!
(
name
,
job
)
validate_job_script!
(
name
,
job
)
validate_job_script!
(
name
,
job
)
validate_job_stage!
(
name
,
job
)
if
job
[
:stage
]
validate_job_variables!
(
name
,
job
)
if
job
[
:variables
]
validate_job_variables!
(
name
,
job
)
if
job
[
:variables
]
validate_job_cache!
(
name
,
job
)
if
job
[
:cache
]
validate_job_cache!
(
name
,
job
)
if
job
[
:cache
]
validate_job_artifacts!
(
name
,
job
)
if
job
[
:artifacts
]
validate_job_artifacts!
(
name
,
job
)
if
job
[
:artifacts
]
...
@@ -186,12 +182,6 @@ module Ci
...
@@ -186,12 +182,6 @@ module Ci
end
end
end
end
def
validate_job_stage!
(
name
,
job
)
unless
job
[
:stage
].
is_a?
(
String
)
&&
job
[
:stage
].
in?
(
@stages
)
raise
ValidationError
,
"
#{
name
}
job: stage parameter should be
#{
@stages
.
join
(
", "
)
}
"
end
end
def
validate_job_variables!
(
name
,
job
)
def
validate_job_variables!
(
name
,
job
)
unless
validate_variables
(
job
[
:variables
])
unless
validate_variables
(
job
[
:variables
])
raise
ValidationError
,
raise
ValidationError
,
...
...
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