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
2f019b2b
Commit
2f019b2b
authored
Feb 09, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup rake tasks since no gitolite required
parent
ff76e052
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
69 deletions
+9
-69
lib/tasks/gitlab/cleanup.rake
lib/tasks/gitlab/cleanup.rake
+0
-33
lib/tasks/gitlab/enable_automerge.rake
lib/tasks/gitlab/enable_automerge.rake
+9
-8
lib/tasks/gitlab/gitolite_rebuild.rake
lib/tasks/gitlab/gitolite_rebuild.rake
+0
-27
lib/tasks/gitlab/setup.rake
lib/tasks/gitlab/setup.rake
+0
-1
No files found.
lib/tasks/gitlab/cleanup.rake
View file @
2f019b2b
namespace
:gitlab
do
namespace
:cleanup
do
desc
"GITLAB | Cleanup | Clean gitolite config"
task
:config
=>
:environment
do
warn_user_is_not_gitlab
real_repos
=
Project
.
all
.
map
(
&
:path_with_namespace
)
real_repos
<<
"gitolite-admin"
real_repos
<<
"@all"
remove_flag
=
ENV
[
'REMOVE'
]
puts
"Looking for repositories to remove... "
Gitlab
::
GitoliteConfig
.
new
.
apply
do
|
config
|
all_repos
=
[]
garbage_repos
=
[]
all_repos
=
config
.
conf
.
repos
.
keys
garbage_repos
=
all_repos
-
real_repos
garbage_repos
.
each
do
|
repo_name
|
if
remove_flag
config
.
conf
.
rm_repo
(
repo_name
)
print
"to remove..."
.
red
end
puts
repo_name
.
red
end
end
unless
remove_flag
puts
"To cleanup repositories run this command with REMOVE=true"
.
yellow
end
end
desc
"GITLAB | Cleanup | Clean namespaces"
task
:dirs
=>
:environment
do
warn_user_is_not_gitlab
...
...
lib/tasks/gitlab/enable_automerge.rake
View file @
2f019b2b
namespace
:gitlab
do
desc
"GITLAB | Enable auto merge"
task
:enable_automerge
=>
:environment
do
namespace
:satellites
do
desc
"GITLAB | Create satellite repos"
task
create: :environment
do
create_satellites
end
end
def
create_satellites
warn_user_is_not_gitlab
print
"Creating satellites for ..."
unless
Project
.
count
>
0
puts
"skipping, because you have no projects"
.
magenta
next
return
end
puts
""
...
...
@@ -33,9 +39,4 @@ namespace :gitlab do
end
end
end
namespace
:satellites
do
desc
"GITLAB | Create satellite repos"
task
create:
'gitlab:enable_automerge'
end
end
lib/tasks/gitlab/gitolite_rebuild.rake
deleted
100644 → 0
View file @
ff76e052
namespace
:gitlab
do
namespace
:gitolite
do
desc
"GITLAB | Rebuild each project in Gitolite config"
task
:update_repos
=>
:environment
do
warn_user_is_not_gitlab
puts
"Rebuilding projects ... "
Project
.
find_each
(
:batch_size
=>
100
)
do
|
project
|
puts
"
#{
project
.
name_with_namespace
.
yellow
}
... "
project
.
update_repository
puts
"...
#{
"done"
.
green
}
"
end
end
desc
"GITLAB | Rebuild each user key in Gitolite config"
task
:update_keys
=>
:environment
do
warn_user_is_not_gitlab
puts
"Rebuilding keys ... "
Key
.
find_each
(
:batch_size
=>
100
)
do
|
key
|
puts
"
#{
key
.
identifier
.
yellow
}
... "
Gitlab
::
Gitolite
.
new
.
set_key
(
key
.
identifier
,
key
.
key
,
key
.
projects
)
puts
"...
#{
"done"
.
green
}
"
end
end
end
end
lib/tasks/gitlab/setup.rake
View file @
2f019b2b
...
...
@@ -14,7 +14,6 @@ namespace :gitlab do
Rake
::
Task
[
"db:setup"
].
invoke
Rake
::
Task
[
"db:seed_fu"
].
invoke
Rake
::
Task
[
"gitlab:enable_automerge"
].
invoke
rescue
Gitlab
::
TaskAbortedByUserError
puts
"Quitting..."
.
red
exit
1
...
...
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