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
Tatuya Kamada
gitlab-ce
Commits
393ec8e7
Commit
393ec8e7
authored
Jun 03, 2016
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename `commit` to `pipeline` in application code
parent
20c7144e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
16 deletions
+16
-16
app/services/ci/create_builds_service.rb
app/services/ci/create_builds_service.rb
+9
-9
app/services/create_commit_builds_service.rb
app/services/create_commit_builds_service.rb
+7
-7
No files found.
app/services/ci/create_builds_service.rb
View file @
393ec8e7
module
Ci
module
Ci
class
CreateBuildsService
class
CreateBuildsService
def
initialize
(
commit
)
def
initialize
(
pipeline
)
@
commit
=
commit
@
pipeline
=
pipeline
end
end
def
execute
(
stage
,
user
,
status
,
trigger_request
=
nil
)
def
execute
(
stage
,
user
,
status
,
trigger_request
=
nil
)
...
@@ -21,7 +21,7 @@ module Ci
...
@@ -21,7 +21,7 @@ module Ci
builds_attrs
.
map
do
|
build_attrs
|
builds_attrs
.
map
do
|
build_attrs
|
# don't create the same build twice
# don't create the same build twice
unless
@
commit
.
builds
.
find_by
(
ref:
@commit
.
ref
,
tag:
@commit
.
tag
,
unless
@
pipeline
.
builds
.
find_by
(
ref:
@pipeline
.
ref
,
tag:
@pipeline
.
tag
,
trigger_request:
trigger_request
,
name:
build_attrs
[
:name
])
trigger_request:
trigger_request
,
name:
build_attrs
[
:name
])
build_attrs
.
slice!
(
:name
,
build_attrs
.
slice!
(
:name
,
:commands
,
:commands
,
...
@@ -31,13 +31,13 @@ module Ci
...
@@ -31,13 +31,13 @@ module Ci
:stage
,
:stage
,
:stage_idx
)
:stage_idx
)
build_attrs
.
merge!
(
ref:
@
commit
.
ref
,
build_attrs
.
merge!
(
ref:
@
pipeline
.
ref
,
tag:
@
commit
.
tag
,
tag:
@
pipeline
.
tag
,
trigger_request:
trigger_request
,
trigger_request:
trigger_request
,
user:
user
,
user:
user
,
project:
@
commit
.
project
)
project:
@
pipeline
.
project
)
@
commit
.
builds
.
create!
(
build_attrs
)
@
pipeline
.
builds
.
create!
(
build_attrs
)
end
end
end
end
end
end
...
@@ -45,7 +45,7 @@ module Ci
...
@@ -45,7 +45,7 @@ module Ci
private
private
def
config_processor
def
config_processor
@config_processor
||=
@
commit
.
config_processor
@config_processor
||=
@
pipeline
.
config_processor
end
end
end
end
end
end
app/services/create_commit_builds_service.rb
View file @
393ec8e7
...
@@ -18,23 +18,23 @@ class CreateCommitBuildsService
...
@@ -18,23 +18,23 @@ class CreateCommitBuildsService
return
false
return
false
end
end
commit
=
Ci
::
Pipeline
.
new
(
project:
project
,
sha:
sha
,
ref:
ref
,
before_sha:
before_sha
,
tag:
tag
)
pipeline
=
Ci
::
Pipeline
.
new
(
project:
project
,
sha:
sha
,
ref:
ref
,
before_sha:
before_sha
,
tag:
tag
)
# Skip creating ci_commit when no gitlab-ci.yml is found
# Skip creating ci_commit when no gitlab-ci.yml is found
unless
commit
.
ci_yaml_file
unless
pipeline
.
ci_yaml_file
return
false
return
false
end
end
# Create a new ci_commit
# Create a new ci_commit
commit
.
save!
pipeline
.
save!
# Skip creating builds for commits that have [ci skip]
# Skip creating builds for commits that have [ci skip]
unless
commit
.
skip_ci?
unless
pipeline
.
skip_ci?
# Create builds for commit
# Create builds for commit
commit
.
create_builds
(
user
)
pipeline
.
create_builds
(
user
)
end
end
commit
.
touch
pipeline
.
touch
commit
pipeline
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