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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
dcdf2a8b
Commit
dcdf2a8b
authored
Jun 28, 2017
by
Tomasz Maczukin
Committed by
Grzegorz Bizon
Jul 02, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make entrypoint and command keys to be array of strings
parent
8513072e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
16 deletions
+25
-16
lib/gitlab/ci/config/entry/image.rb
lib/gitlab/ci/config/entry/image.rb
+1
-1
lib/gitlab/ci/config/entry/service.rb
lib/gitlab/ci/config/entry/service.rb
+2
-2
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+17
-8
spec/lib/gitlab/ci/config/entry/image_spec.rb
spec/lib/gitlab/ci/config/entry/image_spec.rb
+2
-2
spec/lib/gitlab/ci/config/entry/service_spec.rb
spec/lib/gitlab/ci/config/entry/service_spec.rb
+3
-3
No files found.
lib/gitlab/ci/config/entry/image.rb
View file @
dcdf2a8b
...
@@ -15,7 +15,7 @@ module Gitlab
...
@@ -15,7 +15,7 @@ module Gitlab
validates
:config
,
allowed_keys:
ALLOWED_KEYS
validates
:config
,
allowed_keys:
ALLOWED_KEYS
validates
:name
,
type:
String
,
presence:
true
validates
:name
,
type:
String
,
presence:
true
validates
:entrypoint
,
type:
String
,
allow_nil:
true
validates
:entrypoint
,
array_of_strings:
true
,
allow_nil:
true
end
end
def
hash?
def
hash?
...
...
lib/gitlab/ci/config/entry/service.rb
View file @
dcdf2a8b
...
@@ -15,8 +15,8 @@ module Gitlab
...
@@ -15,8 +15,8 @@ module Gitlab
validates
:config
,
allowed_keys:
ALLOWED_KEYS
validates
:config
,
allowed_keys:
ALLOWED_KEYS
validates
:name
,
type:
String
,
presence:
true
validates
:name
,
type:
String
,
presence:
true
validates
:entrypoint
,
type:
String
,
allow_nil:
true
validates
:entrypoint
,
array_of_strings:
true
,
allow_nil:
true
validates
:command
,
type:
String
,
allow_nil:
true
validates
:command
,
array_of_strings:
true
,
allow_nil:
true
validates
:alias
,
type:
String
,
allow_nil:
true
validates
:alias
,
type:
String
,
allow_nil:
true
end
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
dcdf2a8b
...
@@ -598,8 +598,10 @@ module Ci
...
@@ -598,8 +598,10 @@ module Ci
describe
"Image and service handling"
do
describe
"Image and service handling"
do
context
"when extended docker configuration is used"
do
context
"when extended docker configuration is used"
do
it
"returns image and service when defined"
do
it
"returns image and service when defined"
do
config
=
YAML
.
dump
({
image:
{
name:
"ruby:2.1"
},
config
=
YAML
.
dump
({
image:
{
name:
"ruby:2.1"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
services:
[
"mysql"
,
{
name:
"docker:dind"
,
alias:
"docker"
}],
services:
[
"mysql"
,
{
name:
"docker:dind"
,
alias:
"docker"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
],
command:
[
"/usr/local/bin/init"
,
"run"
]
}],
before_script:
[
"pwd"
],
before_script:
[
"pwd"
],
rspec:
{
script:
"rspec"
}
})
rspec:
{
script:
"rspec"
}
})
...
@@ -614,8 +616,10 @@ module Ci
...
@@ -614,8 +616,10 @@ module Ci
coverage_regex:
nil
,
coverage_regex:
nil
,
tag_list:
[],
tag_list:
[],
options:
{
options:
{
image:
{
name:
"ruby:2.1"
},
image:
{
name:
"ruby:2.1"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
services:
[{
name:
"mysql"
},
{
name:
"docker:dind"
,
alias:
"docker"
}]
services:
[{
name:
"mysql"
},
{
name:
"docker:dind"
,
alias:
"docker"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
],
command:
[
"/usr/local/bin/init"
,
"run"
]
}]
},
},
allow_failure:
false
,
allow_failure:
false
,
when:
"on_success"
,
when:
"on_success"
,
...
@@ -628,8 +632,11 @@ module Ci
...
@@ -628,8 +632,11 @@ module Ci
config
=
YAML
.
dump
({
image:
"ruby:2.1"
,
config
=
YAML
.
dump
({
image:
"ruby:2.1"
,
services:
[
"mysql"
],
services:
[
"mysql"
],
before_script:
[
"pwd"
],
before_script:
[
"pwd"
],
rspec:
{
image:
{
name:
"ruby:2.5"
},
rspec:
{
image:
{
name:
"ruby:2.5"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
services:
[{
name:
"postgresql"
,
alias:
"db-pg"
},
"docker:dind"
],
script:
"rspec"
}
})
services:
[{
name:
"postgresql"
,
alias:
"db-pg"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
],
command:
[
"/usr/local/bin/init"
,
"run"
]
},
"docker:dind"
],
script:
"rspec"
}
})
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
config_processor
=
GitlabCiYamlProcessor
.
new
(
config
,
path
)
...
@@ -642,8 +649,10 @@ module Ci
...
@@ -642,8 +649,10 @@ module Ci
coverage_regex:
nil
,
coverage_regex:
nil
,
tag_list:
[],
tag_list:
[],
options:
{
options:
{
image:
{
name:
"ruby:2.5"
},
image:
{
name:
"ruby:2.5"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
]
},
services:
[{
name:
"postgresql"
,
alias:
"db-pg"
},
{
name:
"docker:dind"
}]
services:
[{
name:
"postgresql"
,
alias:
"db-pg"
,
entrypoint:
[
"/usr/local/bin/init"
,
"run"
],
command:
[
"/usr/local/bin/init"
,
"run"
]},
{
name:
"docker:dind"
}]
},
},
allow_failure:
false
,
allow_failure:
false
,
when:
"on_success"
,
when:
"on_success"
,
...
...
spec/lib/gitlab/ci/config/entry/image_spec.rb
View file @
dcdf2a8b
...
@@ -38,7 +38,7 @@ describe Gitlab::Ci::Config::Entry::Image do
...
@@ -38,7 +38,7 @@ describe Gitlab::Ci::Config::Entry::Image do
end
end
context
'when configuration is a hash'
do
context
'when configuration is a hash'
do
let
(
:config
)
{
{
name:
'ruby:2.2'
,
entrypoint:
'/bin/sh'
}
}
let
(
:config
)
{
{
name:
'ruby:2.2'
,
entrypoint:
[
'/bin/sh'
,
'run'
]
}
}
describe
'#value'
do
describe
'#value'
do
it
'returns image hash'
do
it
'returns image hash'
do
...
@@ -66,7 +66,7 @@ describe Gitlab::Ci::Config::Entry::Image do
...
@@ -66,7 +66,7 @@ describe Gitlab::Ci::Config::Entry::Image do
describe
'#entrypoint'
do
describe
'#entrypoint'
do
it
"returns image's entrypoint"
do
it
"returns image's entrypoint"
do
expect
(
entry
.
entrypoint
).
to
eq
'/bin/sh'
expect
(
entry
.
entrypoint
).
to
eq
[
'/bin/sh'
,
'run'
]
end
end
end
end
end
end
...
...
spec/lib/gitlab/ci/config/entry/service_spec.rb
View file @
dcdf2a8b
...
@@ -43,7 +43,7 @@ describe Gitlab::Ci::Config::Entry::Service do
...
@@ -43,7 +43,7 @@ describe Gitlab::Ci::Config::Entry::Service do
context
'when configuration is a hash'
do
context
'when configuration is a hash'
do
let
(
:config
)
do
let
(
:config
)
do
{
name:
'postgresql:9.5'
,
alias:
'db'
,
command:
'cmd'
,
entrypoint:
'/bin/sh'
}
{
name:
'postgresql:9.5'
,
alias:
'db'
,
command:
[
'cmd'
,
'run'
],
entrypoint:
[
'/bin/sh'
,
'run'
]
}
end
end
describe
'#valid?'
do
describe
'#valid?'
do
...
@@ -72,13 +72,13 @@ describe Gitlab::Ci::Config::Entry::Service do
...
@@ -72,13 +72,13 @@ describe Gitlab::Ci::Config::Entry::Service do
describe
'#command'
do
describe
'#command'
do
it
"returns service's command"
do
it
"returns service's command"
do
expect
(
entry
.
command
).
to
eq
'cmd'
expect
(
entry
.
command
).
to
eq
[
'cmd'
,
'run'
]
end
end
end
end
describe
'#entrypoint'
do
describe
'#entrypoint'
do
it
"returns service's entrypoint"
do
it
"returns service's entrypoint"
do
expect
(
entry
.
entrypoint
).
to
eq
'/bin/sh'
expect
(
entry
.
entrypoint
).
to
eq
[
'/bin/sh'
,
'run'
]
end
end
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