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
df25c196
Commit
df25c196
authored
Jun 07, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use Ci config validation helpers only where needed
parent
6bd67f52
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
17 deletions
+19
-17
gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+1
-1
before_script.rb
lib/gitlab/ci/config/node/before_script.rb
+2
-0
entry.rb
lib/gitlab/ci/config/node/entry.rb
+0
-2
validation_helpers.rb
lib/gitlab/ci/config/node/validation_helpers.rb
+16
-14
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
df25c196
...
...
@@ -2,7 +2,7 @@ module Ci
class
GitlabCiYamlProcessor
class
ValidationError
<
StandardError
;
end
include
Gitlab
::
Ci
::
Config
::
ValidationHelpers
include
Gitlab
::
Ci
::
Config
::
Node
::
ValidationHelpers
DEFAULT_STAGES
=
%w(build test deploy)
DEFAULT_STAGE
=
'test'
...
...
lib/gitlab/ci/config/node/before_script.rb
View file @
df25c196
...
...
@@ -3,6 +3,8 @@ module Gitlab
class
Config
module
Node
class
BeforeScript
<
Entry
include
ValidationHelpers
def
keys
{}
end
...
...
lib/gitlab/ci/config/node/entry.rb
View file @
df25c196
...
...
@@ -3,8 +3,6 @@ module Gitlab
class
Config
module
Node
class
Entry
include
Config
::
ValidationHelpers
attr_reader
:value
,
:nodes
,
:parent
def
initialize
(
value
,
root
=
nil
,
parent
=
nil
)
...
...
lib/gitlab/ci/config/validation_helpers.rb
→
lib/gitlab/ci/config/
node/
validation_helpers.rb
View file @
df25c196
module
Gitlab
module
Ci
class
Config
module
ValidationHelpers
private
module
Node
module
ValidationHelpers
private
def
validate_array_of_strings
(
values
)
values
.
is_a?
(
Array
)
&&
values
.
all?
{
|
value
|
validate_string
(
value
)
}
end
def
validate_array_of_strings
(
values
)
values
.
is_a?
(
Array
)
&&
values
.
all?
{
|
value
|
validate_string
(
value
)
}
end
def
validate_variables
(
variables
)
variables
.
is_a?
(
Hash
)
&&
variables
.
all?
{
|
key
,
value
|
validate_string
(
key
)
&&
validate_string
(
value
)
}
end
def
validate_variables
(
variables
)
variables
.
is_a?
(
Hash
)
&&
variables
.
all?
{
|
key
,
value
|
validate_string
(
key
)
&&
validate_string
(
value
)
}
end
def
validate_string
(
value
)
value
.
is_a?
(
String
)
||
value
.
is_a?
(
Symbol
)
end
def
validate_string
(
value
)
value
.
is_a?
(
String
)
||
value
.
is_a?
(
Symbol
)
end
def
validate_boolean
(
value
)
value
.
in?
([
true
,
false
])
def
validate_boolean
(
value
)
value
.
in?
([
true
,
false
])
end
end
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