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
iv
gitlab-ce
Commits
e8f995ef
Commit
e8f995ef
authored
Jun 07, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass root Ci config entry to each subsequent entry
parent
69a3755c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
10 deletions
+8
-10
lib/gitlab/ci/config.rb
lib/gitlab/ci/config.rb
+1
-1
lib/gitlab/ci/config/node/entry.rb
lib/gitlab/ci/config/node/entry.rb
+5
-5
spec/lib/gitlab/ci/config/node/before_script_spec.rb
spec/lib/gitlab/ci/config/node/before_script_spec.rb
+1
-2
spec/lib/gitlab/ci/config/node/global_spec.rb
spec/lib/gitlab/ci/config/node/global_spec.rb
+1
-2
No files found.
lib/gitlab/ci/config.rb
View file @
e8f995ef
...
@@ -13,7 +13,7 @@ module Gitlab
...
@@ -13,7 +13,7 @@ module Gitlab
end
end
@config
=
loader
.
load
@config
=
loader
.
load
@global
=
Node
::
Global
.
new
(
@config
,
self
)
@global
=
Node
::
Global
.
new
(
@config
)
@global
.
process!
@global
.
process!
end
end
...
...
lib/gitlab/ci/config/node/entry.rb
View file @
e8f995ef
...
@@ -7,14 +7,14 @@ module Gitlab
...
@@ -7,14 +7,14 @@ module Gitlab
attr_reader
:value
,
:nodes
,
:parent
attr_reader
:value
,
:nodes
,
:parent
def
initialize
(
value
,
config
,
parent
=
nil
)
def
initialize
(
value
,
root
=
nil
,
parent
=
nil
)
@value
=
value
@value
=
value
@
config
=
config
@
root
=
root
@parent
=
parent
@parent
=
parent
@nodes
,
@errors
=
[],
[]
@nodes
,
@errors
=
[],
[]
keys
.
each_key
do
|
key
|
keys
.
each_key
do
|
key
|
instance_variable_set
(
"@
#{
key
}
"
,
Null
.
new
(
nil
,
config
,
self
))
instance_variable_set
(
"@
#{
key
}
"
,
Null
.
new
(
nil
,
root
,
self
))
end
end
end
end
...
@@ -24,7 +24,7 @@ module Gitlab
...
@@ -24,7 +24,7 @@ module Gitlab
keys
.
each
do
|
key
,
entry_class
|
keys
.
each
do
|
key
,
entry_class
|
next
unless
@value
.
has_key?
(
key
)
next
unless
@value
.
has_key?
(
key
)
entry
=
entry_class
.
new
(
@value
[
key
],
@
config
,
self
)
entry
=
entry_class
.
new
(
@value
[
key
],
@
root
,
self
)
instance_variable_set
(
"@
#{
key
}
"
,
entry
)
instance_variable_set
(
"@
#{
key
}
"
,
entry
)
@nodes
.
append
(
entry
)
@nodes
.
append
(
entry
)
end
end
...
@@ -42,7 +42,7 @@ module Gitlab
...
@@ -42,7 +42,7 @@ module Gitlab
end
end
def
leaf?
def
leaf?
keys
.
none?
keys
.
none?
# TODO || !@value.is_a?(Hash)
end
end
def
keys
def
keys
...
...
spec/lib/gitlab/ci/config/node/before_script_spec.rb
View file @
e8f995ef
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Node
::
BeforeScript
do
describe
Gitlab
::
Ci
::
Config
::
Node
::
BeforeScript
do
let
(
:entry
)
{
described_class
.
new
(
value
,
config
)
}
let
(
:entry
)
{
described_class
.
new
(
value
,
double
)}
let
(
:config
)
{
double
(
'config'
)
}
describe
'#validate!'
do
describe
'#validate!'
do
before
{
entry
.
validate!
}
before
{
entry
.
validate!
}
...
...
spec/lib/gitlab/ci/config/node/global_spec.rb
View file @
e8f995ef
require
'spec_helper'
require
'spec_helper'
describe
Gitlab
::
Ci
::
Config
::
Node
::
Global
do
describe
Gitlab
::
Ci
::
Config
::
Node
::
Global
do
let
(
:global
)
{
described_class
.
new
(
hash
,
config
)
}
let
(
:global
)
{
described_class
.
new
(
hash
)
}
let
(
:config
)
{
double
(
'Config'
)
}
describe
'#keys'
do
describe
'#keys'
do
it
'can contain global config keys'
do
it
'can contain global config keys'
do
...
...
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