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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
be56144a
Commit
be56144a
authored
Jun 02, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ci_yml_file' into 'master'
GitLab CI service sends gitlab-ci.yml file See merge request !689
parents
1c328fa4
b931c11e
Changes
3
Hide 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 @
be56144a
...
...
@@ -39,6 +39,7 @@ v 7.12.0 (unreleased)
- Allow to configure a URL to show after sign out
- Add an option to automatically sign-in with an Omniauth provider
- 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
- Fix missing bullets when creating lists
...
...
app/models/project_services/gitlab_ci_service.rb
View file @
be56144a
...
...
@@ -40,6 +40,12 @@ class GitlabCiService < CiService
def
execute
(
data
)
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
)
end
...
...
@@ -123,6 +129,14 @@ class GitlabCiService < CiService
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
project_url
.
sub
(
/projects\/\d*/
,
"
#{
API_PREFIX
}
/forks"
)
end
...
...
spec/models/project_services/gitlab_ci_service_spec.rb
View file @
be56144a
...
...
@@ -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
(
"issue#2"
,
'master'
)).
to
eq
(
"http://ci.gitlab.org/projects/2/refs/master/commits/issue%232"
)}
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
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