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
003526e2
Commit
003526e2
authored
May 14, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add method new_pipeline
parent
2566c89a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
app/services/ci/create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+6
-4
No files found.
app/services/ci/create_pipeline_service.rb
View file @
003526e2
...
@@ -13,6 +13,8 @@ module Ci
...
@@ -13,6 +13,8 @@ module Ci
raise
RuntimeError
,
'Insufficient permissions to create a new pipeline'
raise
RuntimeError
,
'Insufficient permissions to create a new pipeline'
end
end
pipeline
=
new_pipeline
Ci
::
Commit
.
transaction
do
Ci
::
Commit
.
transaction
do
unless
pipeline
.
config_processor
unless
pipeline
.
config_processor
raise
ArgumentError
,
pipeline
.
yaml_errors
||
'Missing .gitlab-ci.yml file'
raise
ArgumentError
,
pipeline
.
yaml_errors
||
'Missing .gitlab-ci.yml file'
...
@@ -27,6 +29,10 @@ module Ci
...
@@ -27,6 +29,10 @@ module Ci
private
private
def
new_pipeline
project
.
ci_commits
.
new
(
sha:
commit
.
id
,
ref:
params
[
:ref
],
before_sha:
Gitlab
::
Git
::
BLANK_SHA
)
end
def
ref_names
def
ref_names
@ref_names
||=
project
.
repository
.
ref_names
@ref_names
||=
project
.
repository
.
ref_names
end
end
...
@@ -34,9 +40,5 @@ module Ci
...
@@ -34,9 +40,5 @@ module Ci
def
commit
def
commit
@commit
||=
project
.
commit
(
params
[
:ref
])
@commit
||=
project
.
commit
(
params
[
:ref
])
end
end
def
pipeline
@pipeline
||=
project
.
ci_commits
.
new
(
sha:
commit
.
id
,
ref:
params
[
:ref
],
before_sha:
Gitlab
::
Git
::
BLANK_SHA
)
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