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
500b61e1
Commit
500b61e1
authored
Jul 10, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move after script CI job confg to new processor
parent
489e9be4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
5 deletions
+11
-5
job.rb
lib/gitlab/ci/config/node/job.rb
+6
-2
gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+1
-1
job_spec.rb
spec/lib/gitlab/ci/config/node/job_spec.rb
+4
-2
No files found.
lib/gitlab/ci/config/node/job.rb
View file @
500b61e1
...
@@ -24,7 +24,10 @@ module Gitlab
...
@@ -24,7 +24,10 @@ module Gitlab
node
:type
,
Stage
,
node
:type
,
Stage
,
description:
'Deprecated: stage this job will be executed into.'
description:
'Deprecated: stage this job will be executed into.'
helpers
:before_script
,
:script
,
:stage
,
:type
node
:after_script
,
Script
,
description:
'Commands that will be executed when finishing job.'
helpers
:before_script
,
:script
,
:stage
,
:type
,
:after_script
def
value
def
value
raise
InvalidError
unless
valid?
raise
InvalidError
unless
valid?
...
@@ -41,7 +44,8 @@ module Gitlab
...
@@ -41,7 +44,8 @@ module Gitlab
def
to_hash
def
to_hash
{
before_script:
before_script_value
,
{
before_script:
before_script_value
,
script:
script_value
,
script:
script_value
,
stage:
stage_value
}
stage:
stage_value
,
after_script:
after_script_value
}
end
end
def
compose!
def
compose!
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
500b61e1
...
@@ -984,7 +984,7 @@ EOT
...
@@ -984,7 +984,7 @@ EOT
config
=
YAML
.
dump
({
rspec:
{
script:
"test"
,
after_script:
[
10
,
"test"
]
}
})
config
=
YAML
.
dump
({
rspec:
{
script:
"test"
,
after_script:
[
10
,
"test"
]
}
})
expect
do
expect
do
GitlabCiYamlProcessor
.
new
(
config
,
path
)
GitlabCiYamlProcessor
.
new
(
config
,
path
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
rspec job: after_script
should be an array of strings"
)
end
.
to
raise_error
(
GitlabCiYamlProcessor
::
ValidationError
,
"
jobs:rspec:after_script config
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
...
...
spec/lib/gitlab/ci/config/node/job_spec.rb
View file @
500b61e1
...
@@ -48,14 +48,16 @@ describe Gitlab::Ci::Config::Node::Job do
...
@@ -48,14 +48,16 @@ describe Gitlab::Ci::Config::Node::Job do
context
'when entry is correct'
do
context
'when entry is correct'
do
let
(
:config
)
do
let
(
:config
)
do
{
before_script:
%w[ls pwd]
,
{
before_script:
%w[ls pwd]
,
script:
'rspec'
}
script:
'rspec'
,
after_script:
%w[cleanup]
}
end
end
it
'returns correct value'
do
it
'returns correct value'
do
expect
(
entry
.
value
)
expect
(
entry
.
value
)
.
to
eq
(
before_script:
%w[ls pwd]
,
.
to
eq
(
before_script:
%w[ls pwd]
,
script:
%w[rspec]
,
script:
%w[rspec]
,
stage:
'test'
)
stage:
'test'
,
after_script:
%w[cleanup]
)
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