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
b931c11e
Commit
b931c11e
authored
May 21, 2015
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GitLab CI service sends gitlab-ci.yml file
parent
1c328fa4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
0 deletions
+30
-0
CHANGELOG
CHANGELOG
+1
-0
app/models/project_services/gitlab_ci_service.rb
app/models/project_services/gitlab_ci_service.rb
+14
-0
spec/models/project_services/gitlab_ci_service_spec.rb
spec/models/project_services/gitlab_ci_service_spec.rb
+15
-0
No files found.
CHANGELOG
View file @
b931c11e
...
@@ -39,6 +39,7 @@ v 7.12.0 (unreleased)
...
@@ -39,6 +39,7 @@ v 7.12.0 (unreleased)
- Allow to configure a URL to show after sign out
- Allow to configure a URL to show after sign out
- Add an option to automatically sign-in with an Omniauth provider
- Add an option to automatically sign-in with an Omniauth provider
- Better performance for web editor (switched from satellites to rugged)
- Better performance for web editor (switched from satellites to rugged)
- GitLab CI service sends .gitlab-ci.yaml in each push call
v 7.11.4
v 7.11.4
- Fix missing bullets when creating lists
- Fix missing bullets when creating lists
...
...
app/models/project_services/gitlab_ci_service.rb
View file @
b931c11e
...
@@ -40,6 +40,12 @@ class GitlabCiService < CiService
...
@@ -40,6 +40,12 @@ class GitlabCiService < CiService
def
execute
(
data
)
def
execute
(
data
)
return
unless
supported_events
.
include?
(
data
[
:object_kind
])
return
unless
supported_events
.
include?
(
data
[
:object_kind
])
ci_yaml_file
=
ci_yaml_file
(
data
)
if
ci_yaml_file
data
.
merge!
(
ci_yaml_file:
ci_yaml_file
)
end
service_hook
.
execute
(
data
)
service_hook
.
execute
(
data
)
end
end
...
@@ -123,6 +129,14 @@ class GitlabCiService < CiService
...
@@ -123,6 +129,14 @@ class GitlabCiService < CiService
private
private
def
ci_yaml_file
(
data
)
ref
=
data
[
:checkout_sha
]
repo
=
project
.
repository
commit
=
repo
.
commit
(
ref
)
blob
=
Gitlab
::
Git
::
Blob
.
find
(
repo
,
commit
.
id
,
".gitlab-ci.yml"
)
blob
&&
blob
.
data
end
def
fork_registration_path
def
fork_registration_path
project_url
.
sub
(
/projects\/\d*/
,
"
#{
API_PREFIX
}
/forks"
)
project_url
.
sub
(
/projects\/\d*/
,
"
#{
API_PREFIX
}
/forks"
)
end
end
...
...
spec/models/project_services/gitlab_ci_service_spec.rb
View file @
b931c11e
...
@@ -48,6 +48,21 @@ describe GitlabCiService do
...
@@ -48,6 +48,21 @@ describe GitlabCiService do
it
{
expect
(
@service
.
build_page
(
"2ab7834c"
,
'master'
)).
to
eq
(
"http://ci.gitlab.org/projects/2/refs/master/commits/2ab7834c"
)}
it
{
expect
(
@service
.
build_page
(
"2ab7834c"
,
'master'
)).
to
eq
(
"http://ci.gitlab.org/projects/2/refs/master/commits/2ab7834c"
)}
it
{
expect
(
@service
.
build_page
(
"issue#2"
,
'master'
)).
to
eq
(
"http://ci.gitlab.org/projects/2/refs/master/commits/issue%232"
)}
it
{
expect
(
@service
.
build_page
(
"issue#2"
,
'master'
)).
to
eq
(
"http://ci.gitlab.org/projects/2/refs/master/commits/issue%232"
)}
end
end
describe
"execute"
do
let
(
:user
)
{
create
(
:user
,
username:
'username'
)
}
let
(
:project
)
{
create
(
:project
,
name:
'project'
)
}
let
(
:push_sample_data
)
{
Gitlab
::
PushDataBuilder
.
build_sample
(
project
,
user
)
}
it
"calls ci_yaml_file"
do
service_hook
=
double
service_hook
.
should_receive
(
:execute
)
@service
.
should_receive
(
:service_hook
).
and_return
(
service_hook
)
@service
.
should_receive
(
:ci_yaml_file
).
with
(
push_sample_data
)
@service
.
execute
(
push_sample_data
)
end
end
end
end
describe
"Fork registration"
do
describe
"Fork registration"
do
...
...
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