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
Boxiang Sun
gitlab-ce
Commits
0ce1826b
Commit
0ce1826b
authored
Nov 06, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8258 from cirosantilli/factor-repo-path
Factor using Repository#path_to_repo
parents
6d607627
e4a38e44
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
8 deletions
+5
-8
app/models/project_services/flowdock_service.rb
app/models/project_services/flowdock_service.rb
+1
-2
app/models/project_services/gemnasium_service.rb
app/models/project_services/gemnasium_service.rb
+1
-2
lib/backup/repository.rb
lib/backup/repository.rb
+1
-1
lib/tasks/gitlab/shell.rake
lib/tasks/gitlab/shell.rake
+1
-1
spec/requests/api/repositories_spec.rb
spec/requests/api/repositories_spec.rb
+1
-2
No files found.
app/models/project_services/flowdock_service.rb
View file @
0ce1826b
...
@@ -37,13 +37,12 @@ class FlowdockService < Service
...
@@ -37,13 +37,12 @@ class FlowdockService < Service
end
end
def
execute
(
push_data
)
def
execute
(
push_data
)
repo_path
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
"
#{
project
.
path_with_namespace
}
.git"
)
Flowdock
::
Git
.
post
(
Flowdock
::
Git
.
post
(
push_data
[
:ref
],
push_data
[
:ref
],
push_data
[
:before
],
push_data
[
:before
],
push_data
[
:after
],
push_data
[
:after
],
token:
token
,
token:
token
,
repo:
repo_path
,
repo:
project
.
repository
.
path_to_repo
,
repo_url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
"
,
repo_url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
"
,
commit_url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
/commit/%s"
,
commit_url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
/commit/%s"
,
diff_url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
/compare/%s...%s"
,
diff_url:
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/
#{
project
.
path_with_namespace
}
/compare/%s...%s"
,
...
...
app/models/project_services/gemnasium_service.rb
View file @
0ce1826b
...
@@ -38,14 +38,13 @@ class GemnasiumService < Service
...
@@ -38,14 +38,13 @@ class GemnasiumService < Service
end
end
def
execute
(
push_data
)
def
execute
(
push_data
)
repo_path
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
"
#{
project
.
path_with_namespace
}
.git"
)
Gemnasium
::
GitlabService
.
execute
(
Gemnasium
::
GitlabService
.
execute
(
ref:
push_data
[
:ref
],
ref:
push_data
[
:ref
],
before:
push_data
[
:before
],
before:
push_data
[
:before
],
after:
push_data
[
:after
],
after:
push_data
[
:after
],
token:
token
,
token:
token
,
api_key:
api_key
,
api_key:
api_key
,
repo:
repo_path
repo:
project
.
repository
.
path_to_repo
)
)
end
end
end
end
lib/backup/repository.rb
View file @
0ce1826b
...
@@ -91,7 +91,7 @@ module Backup
...
@@ -91,7 +91,7 @@ module Backup
protected
protected
def
path_to_repo
(
project
)
def
path_to_repo
(
project
)
File
.
join
(
repos_path
,
project
.
path_with_namespace
+
'.git'
)
project
.
repository
.
path_to_repo
end
end
def
path_to_bundle
(
project
)
def
path_to_bundle
(
project
)
...
...
lib/tasks/gitlab/shell.rake
View file @
0ce1826b
...
@@ -76,7 +76,7 @@ namespace :gitlab do
...
@@ -76,7 +76,7 @@ namespace :gitlab do
desc
"GITLAB | Build missing projects"
desc
"GITLAB | Build missing projects"
task
build_missing_projects: :environment
do
task
build_missing_projects: :environment
do
Project
.
find_each
(
batch_size:
1000
)
do
|
project
|
Project
.
find_each
(
batch_size:
1000
)
do
|
project
|
path_to_repo
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
"
#{
project
.
path_with_namespace
}
.git"
)
path_to_repo
=
project
.
repository
.
path_to_repo
if
File
.
exists?
(
path_to_repo
)
if
File
.
exists?
(
path_to_repo
)
print
'-'
print
'-'
else
else
...
...
spec/requests/api/repositories_spec.rb
View file @
0ce1826b
...
@@ -37,8 +37,7 @@ describe API::API, api: true do
...
@@ -37,8 +37,7 @@ describe API::API, api: true do
context
'annotated tag'
do
context
'annotated tag'
do
it
'should create a new annotated tag'
do
it
'should create a new annotated tag'
do
# Identity must be set in .gitconfig to create annotated tag.
# Identity must be set in .gitconfig to create annotated tag.
repo_path
=
File
.
join
(
Gitlab
.
config
.
gitlab_shell
.
repos_path
,
repo_path
=
project
.
repository
.
path_to_repo
project
.
path_with_namespace
+
'.git'
)
system
(
*
%W(git --git-dir=
#{
repo_path
}
config user.name
#{
user
.
name
}
)
)
system
(
*
%W(git --git-dir=
#{
repo_path
}
config user.name
#{
user
.
name
}
)
)
system
(
*
%W(git --git-dir=
#{
repo_path
}
config user.email
#{
user
.
email
}
)
)
system
(
*
%W(git --git-dir=
#{
repo_path
}
config user.email
#{
user
.
email
}
)
)
...
...
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