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
9d4c9272
Commit
9d4c9272
authored
Mar 12, 2018
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document runner's expecations regarding variable collection
parent
a194b198
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
lib/gitlab/ci/variables/collection.rb
lib/gitlab/ci/variables/collection.rb
+11
-6
No files found.
lib/gitlab/ci/variables/collection.rb
View file @
9d4c9272
...
@@ -27,10 +27,15 @@ module Gitlab
...
@@ -27,10 +27,15 @@ module Gitlab
end
end
end
end
##
# If `file: true` has been provided we expose it, otherwise we
# don't expose `file` attribute at all (stems from what the runner
# expects).
#
def
to_runner_variables
def
to_runner_variables
self
.
map
do
|
variable
|
self
.
map
do
|
variable
|
variable
.
to_h
.
reject
do
|
key
,
value
|
variable
.
to_h
.
reject
do
|
component
,
value
|
key
==
:file
&&
value
==
false
component
==
:file
&&
value
==
false
end
end
end
end
end
end
...
@@ -40,10 +45,10 @@ module Gitlab
...
@@ -40,10 +45,10 @@ module Gitlab
def
fabricate
(
resource
)
def
fabricate
(
resource
)
case
resource
case
resource
when
Hash
when
Hash
Variable
.
new
(
resource
.
fetch
(
:key
),
Collection
::
Variable
.
new
(
resource
.
fetch
(
:key
),
resource
.
fetch
(
:value
),
resource
.
fetch
(
:value
),
resource
.
fetch
(
:public
,
false
),
resource
.
fetch
(
:public
,
false
),
resource
.
fetch
(
:file
,
false
))
resource
.
fetch
(
:file
,
false
))
when
::
Ci
::
Variable
when
::
Ci
::
Variable
Variable
.
new
(
resource
.
key
,
resource
.
value
,
false
,
false
)
Variable
.
new
(
resource
.
key
,
resource
.
value
,
false
,
false
)
when
Collection
::
Variable
when
Collection
::
Variable
...
...
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