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
cf53d798
Commit
cf53d798
authored
Jul 05, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract jobs config to separate key in config hash
parent
06c7d6f3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
global.rb
lib/gitlab/ci/config/node/global.rb
+16
-0
global_spec.rb
spec/lib/gitlab/ci/config/node/global_spec.rb
+11
-1
No files found.
lib/gitlab/ci/config/node/global.rb
View file @
cf53d798
...
...
@@ -36,6 +36,22 @@ module Gitlab
helpers
:before_script
,
:image
,
:services
,
:after_script
,
:variables
,
:stages
,
:types
,
:cache
def
initialize
(
config
)
return
super
(
config
)
unless
config
.
is_a?
(
Hash
)
jobs
=
config
.
except
(
*
self
.
class
.
nodes
.
keys
)
global
=
config
.
slice
(
*
self
.
class
.
nodes
.
keys
)
super
(
global
.
merge
(
jobs:
jobs
))
end
##
# Temporary refactoring stub
#
def
jobs
@config
[
:jobs
]
end
def
stages
stages_defined?
?
stages_value
:
types_value
end
...
...
spec/lib/gitlab/ci/config/node/global_spec.rb
View file @
cf53d798
...
...
@@ -22,7 +22,9 @@ describe Gitlab::Ci::Config::Node::Global do
variables:
{
VAR
:
'value'
},
after_script:
[
'make clean'
],
stages:
[
'build'
,
'pages'
],
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
]
}
}
cache:
{
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
]
},
rspec:
{
script:
'rspec'
},
spinach:
{
script:
'spinach'
}
}
end
describe
'#process!'
do
...
...
@@ -120,6 +122,14 @@ describe Gitlab::Ci::Config::Node::Global do
.
to
eq
(
key:
'k'
,
untracked:
true
,
paths:
[
'public/'
])
end
end
describe
'#jobs'
do
it
'returns jobs configuration'
do
expect
(
global
.
jobs
)
.
to
eq
(
rspec:
{
script:
'rspec'
},
spinach:
{
script:
'spinach'
})
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