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
52ebeb5a
Commit
52ebeb5a
authored
Sep 13, 2016
by
Katarzyna Kobierska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Build attributes with hash, fix gitlab yaml processor tests
parent
cd556253
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
11 deletions
+34
-11
app/services/ci/create_pipeline_builds_service.rb
app/services/ci/create_pipeline_builds_service.rb
+13
-4
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
+21
-7
No files found.
app/services/ci/create_pipeline_builds_service.rb
View file @
52ebeb5a
...
...
@@ -13,16 +13,25 @@ module Ci
private
def
create_build
(
build_attributes
)
build_attributes
=
build_attributes
.
merge
(
build_attributes
=
{
stage_idx:
build_attributes
[
:stage_idx
],
stage:
build_attributes
[
:stage
],
commands:
build_attributes
[
:commands
],
tag_list:
build_attributes
[
:tag_list
],
name:
build_attributes
[
:name
],
when:
build_attributes
[
:when
],
allow_failure:
build_attributes
[
:allow_failure
],
environment:
build_attributes
[
:environment
],
yaml_variables:
build_attributes
[
:yaml_variables
],
options:
build_attributes
[
:options
],
pipeline:
pipeline
,
project:
pipeline
.
project
,
ref:
pipeline
.
ref
,
tag:
pipeline
.
tag
,
user:
current_user
,
trigger_request:
trigger_request
)
# OPTIMIZE: We copy over all attributes of Job into Build, therefore this workaround
build_attributes
=
build_attributes
.
except
(
:only
,
:except
)
}
pipeline
.
builds
.
create
(
build_attributes
)
end
...
...
spec/lib/ci/gitlab_ci_yaml_processor_spec.rb
View file @
52ebeb5a
...
...
@@ -26,7 +26,9 @@ module Ci
allow_failure:
false
,
when:
"on_success"
,
environment:
nil
,
yaml_variables:
[]
yaml_variables:
[],
only:
nil
,
except:
nil
})
end
...
...
@@ -443,7 +445,9 @@ module Ci
allow_failure:
false
,
when:
"on_success"
,
environment:
nil
,
yaml_variables:
[]
yaml_variables:
[],
only:
nil
,
except:
nil
})
end
...
...
@@ -471,7 +475,9 @@ module Ci
allow_failure:
false
,
when:
"on_success"
,
environment:
nil
,
yaml_variables:
[]
yaml_variables:
[],
only:
nil
,
except:
nil
})
end
end
...
...
@@ -716,7 +722,9 @@ module Ci
when:
"on_success"
,
allow_failure:
false
,
environment:
nil
,
yaml_variables:
[]
yaml_variables:
[],
only:
nil
,
except:
nil
})
end
...
...
@@ -859,7 +867,9 @@ module Ci
when:
"on_success"
,
allow_failure:
false
,
environment:
nil
,
yaml_variables:
[]
yaml_variables:
[],
only:
nil
,
except:
nil
})
end
end
...
...
@@ -904,7 +914,9 @@ module Ci
when:
"on_success"
,
allow_failure:
false
,
environment:
nil
,
yaml_variables:
[]
yaml_variables:
[],
only:
nil
,
except:
nil
})
expect
(
subject
.
second
).
to
eq
({
stage:
"build"
,
...
...
@@ -916,7 +928,9 @@ module Ci
when:
"on_success"
,
allow_failure:
false
,
environment:
nil
,
yaml_variables:
[]
yaml_variables:
[],
only:
nil
,
except:
nil
})
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