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
Kazuhiko Shiozaki
gitlab-ce
Commits
64295a18
Commit
64295a18
authored
Sep 23, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get GitLabCiService token from CI project
parent
6a326089
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
app/models/project_services/gitlab_ci_service.rb
app/models/project_services/gitlab_ci_service.rb
+7
-4
No files found.
app/models/project_services/gitlab_ci_service.rb
View file @
64295a18
...
...
@@ -21,8 +21,6 @@
class
GitlabCiService
<
CiService
include
Gitlab
::
Application
.
routes
.
url_helpers
prop_accessor
:token
after_save
:compose_service_hook
,
if: :activated?
def
compose_service_hook
...
...
@@ -53,6 +51,12 @@ class GitlabCiService < CiService
end
end
def
token
if
project
.
gitlab_ci_project
.
present?
project
.
gitlab_ci_project
.
token
end
end
def
get_ci_commit
(
sha
,
ref
)
Ci
::
Project
.
find
(
project
.
gitlab_ci_project
).
commits
.
find_by_sha_and_ref!
(
sha
,
ref
)
end
...
...
@@ -69,8 +73,7 @@ class GitlabCiService < CiService
name_with_namespace:
new_project
.
name_with_namespace
,
path_with_namespace:
new_project
.
path_with_namespace
,
web_url:
new_project
.
web_url
,
default_branch:
new_project
.
default_branch
,
ssh_url_to_repo:
new_project
.
ssh_url_to_repo
default_branch:
new_project
.
default_branch
})
ci_project
=
Ci
::
Project
.
find_by!
(
gitlab_id:
project
.
id
)
...
...
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