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
cc57d610
Commit
cc57d610
authored
Apr 17, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename finally_script to after_script
parent
b340b597
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
lib/ci/gitlab_ci_yaml_processor.rb
lib/ci/gitlab_ci_yaml_processor.rb
+6
-6
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+7
-7
No files found.
lib/ci/gitlab_ci_yaml_processor.rb
View file @
cc57d610
...
@@ -4,12 +4,12 @@ module Ci
...
@@ -4,12 +4,12 @@ module Ci
DEFAULT_STAGES
=
%w(build test deploy)
DEFAULT_STAGES
=
%w(build test deploy)
DEFAULT_STAGE
=
'test'
DEFAULT_STAGE
=
'test'
ALLOWED_YAML_KEYS
=
[
:before_script
,
:
finally
_script
,
:image
,
:services
,
:types
,
:stages
,
:variables
,
:cache
]
ALLOWED_YAML_KEYS
=
[
:before_script
,
:
after
_script
,
:image
,
:services
,
:types
,
:stages
,
:variables
,
:cache
]
ALLOWED_JOB_KEYS
=
[
:tags
,
:script
,
:only
,
:except
,
:type
,
:image
,
:services
,
ALLOWED_JOB_KEYS
=
[
:tags
,
:script
,
:only
,
:except
,
:type
,
:image
,
:services
,
:allow_failure
,
:type
,
:stage
,
:when
,
:artifacts
,
:cache
,
:allow_failure
,
:type
,
:stage
,
:when
,
:artifacts
,
:cache
,
:dependencies
]
:dependencies
]
attr_reader
:before_script
,
:
finally
_script
,
:image
,
:services
,
:variables
,
:path
,
:cache
attr_reader
:before_script
,
:
after
_script
,
:image
,
:services
,
:variables
,
:path
,
:cache
def
initialize
(
config
,
path
=
nil
)
def
initialize
(
config
,
path
=
nil
)
@config
=
YAML
.
safe_load
(
config
,
[
Symbol
],
[],
true
)
@config
=
YAML
.
safe_load
(
config
,
[
Symbol
],
[],
true
)
...
@@ -44,7 +44,7 @@ module Ci
...
@@ -44,7 +44,7 @@ module Ci
def
initial_parsing
def
initial_parsing
@before_script
=
@config
[
:before_script
]
||
[]
@before_script
=
@config
[
:before_script
]
||
[]
@
finally_script
=
@config
[
:finally
_script
]
@
after_script
=
@config
[
:after
_script
]
@image
=
@config
[
:image
]
@image
=
@config
[
:image
]
@services
=
@config
[
:services
]
@services
=
@config
[
:services
]
@stages
=
@config
[
:stages
]
||
@config
[
:types
]
@stages
=
@config
[
:stages
]
||
@config
[
:types
]
...
@@ -86,7 +86,7 @@ module Ci
...
@@ -86,7 +86,7 @@ module Ci
artifacts:
job
[
:artifacts
],
artifacts:
job
[
:artifacts
],
cache:
job
[
:cache
]
||
@cache
,
cache:
job
[
:cache
]
||
@cache
,
dependencies:
job
[
:dependencies
],
dependencies:
job
[
:dependencies
],
finally_script:
@finally
_script
,
after_script:
@after
_script
,
}.
compact
}.
compact
}
}
end
end
...
@@ -104,8 +104,8 @@ module Ci
...
@@ -104,8 +104,8 @@ module Ci
raise
ValidationError
,
"before_script should be an array of strings"
raise
ValidationError
,
"before_script should be an array of strings"
end
end
unless
@
finally_script
.
nil?
||
validate_array_of_strings
(
@finally
_script
)
unless
@
after_script
.
nil?
||
validate_array_of_strings
(
@after
_script
)
raise
ValidationError
,
"
finally
_script should be an array of strings"
raise
ValidationError
,
"
after
_script should be an array of strings"
end
end
unless
@image
.
nil?
||
@image
.
is_a?
(
String
)
unless
@image
.
nil?
||
@image
.
is_a?
(
String
)
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
cc57d610
...
@@ -293,17 +293,17 @@ module Ci
...
@@ -293,17 +293,17 @@ module Ci
subject
{
config_processor
.
builds_for_stage_and_ref
(
"test"
,
"master"
).
first
}
subject
{
config_processor
.
builds_for_stage_and_ref
(
"test"
,
"master"
).
first
}
describe
"
finally
_script"
do
describe
"
after
_script"
do
context
"in global context"
do
context
"in global context"
do
let
(
:config
)
{
let
(
:config
)
{
{
{
finally_script:
[
"finally
_script"
],
after_script:
[
"after
_script"
],
test:
{
script:
[
"script"
]
}
test:
{
script:
[
"script"
]
}
}
}
}
}
it
"return
finally
_script in options"
do
it
"return
after
_script in options"
do
expect
(
subject
[
:options
][
:
finally_script
]).
to
eq
([
"finally
_script"
])
expect
(
subject
[
:options
][
:
after_script
]).
to
eq
([
"after
_script"
])
end
end
end
end
end
end
...
@@ -629,11 +629,11 @@ EOT
...
@@ -629,11 +629,11 @@ EOT
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"before_script should be an array of strings"
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"before_script should be an array of strings"
)
end
end
it
"returns errors if
finally
_script parameter is invalid"
do
it
"returns errors if
after
_script parameter is invalid"
do
config
=
YAML
.
dump
({
finally
_script:
"bundle update"
,
rspec:
{
script:
"test"
}
})
config
=
YAML
.
dump
({
after
_script:
"bundle update"
,
rspec:
{
script:
"test"
}
})
expect
do
expect
do
GitlabCiYamlProcessor
.
new
(
config
,
path
)
GitlabCiYamlProcessor
.
new
(
config
,
path
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
finally
_script should be an array of strings"
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
after
_script should be an array of strings"
)
end
end
it
"returns errors if image parameter is invalid"
do
it
"returns errors if image parameter is invalid"
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