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
9776dbda
Commit
9776dbda
authored
Sep 25, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use tag/branch methods to check if pipeline ref exists
parent
8f47d484
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
11 deletions
+5
-11
create_pipeline_service.rb
app/services/ci/create_pipeline_service.rb
+3
-3
validate.rb
lib/gitlab/ci/pipeline/chain/validate.rb
+2
-8
No files found.
app/services/ci/create_pipeline_service.rb
View file @
9776dbda
...
...
@@ -107,8 +107,7 @@ module Ci
def
tag?
return
@is_tag
if
defined?
(
@is_tag
)
@is_tag
=
project
.
repository
.
ref_exists?
(
Gitlab
::
Git
::
TAG_REF_PREFIX
+
ref
)
@is_tag
=
project
.
repository
.
tag_exists?
(
ref
)
end
def
ref
...
...
@@ -120,7 +119,8 @@ module Ci
end
def
pipeline_created_counter
@pipeline_created_counter
||=
Gitlab
::
Metrics
.
counter
(
:pipelines_created_total
,
"Counter of pipelines created"
)
@pipeline_created_counter
||=
Gitlab
::
Metrics
.
counter
(
:pipelines_created_total
,
"Counter of pipelines created"
)
end
end
end
lib/gitlab/ci/pipeline/chain/validate.rb
View file @
9776dbda
...
...
@@ -79,22 +79,16 @@ module Gitlab
end
end
## TODO, move to Pipeline as `branch_exists?`
#
def
branch?
return
@is_branch
if
defined?
(
@is_branch
)
@is_branch
=
project
.
repository
.
ref_exists?
(
Gitlab
::
Git
::
BRANCH_REF_PREFIX
+
pipeline
.
ref
)
@is_branch
=
project
.
repository
.
branch_exists?
(
pipeline
.
ref
)
end
## TODO, move to pipeline as `tag_exists?`
#
def
tag?
return
@is_tag
if
defined?
(
@is_tag
)
@is_tag
=
project
.
repository
.
ref_exists?
(
Gitlab
::
Git
::
TAG_REF_PREFIX
+
pipeline
.
ref
)
@is_tag
=
project
.
repository
.
tag_exists?
(
pipeline
.
ref
)
end
def
error
(
message
)
...
...
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