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
Jérome Perrin
gitlab-ce
Commits
43f5df21
Commit
43f5df21
authored
Apr 04, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gitlab rake tasks refactored
parent
c40c627a
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
152 additions
and
120 deletions
+152
-120
.gitignore
.gitignore
+1
-0
CHANGELOG
CHANGELOG
+8
-0
README.md
README.md
+1
-1
VERSION
VERSION
+1
-1
doc/installation.md
doc/installation.md
+2
-3
lib/tasks/dev/repo.rake
lib/tasks/dev/repo.rake
+26
-0
lib/tasks/dev/user.sh
lib/tasks/dev/user.sh
+0
-0
lib/tasks/dev_repo.rake
lib/tasks/dev_repo.rake
+0
-24
lib/tasks/gitlab/gitolite_rebuild.rake
lib/tasks/gitlab/gitolite_rebuild.rake
+25
-0
lib/tasks/gitlab/setup.rake
lib/tasks/gitlab/setup.rake
+7
-0
lib/tasks/gitlab/status.rake
lib/tasks/gitlab/status.rake
+62
-0
lib/tasks/gitlab/update_hooks.rake
lib/tasks/gitlab/update_hooks.rake
+19
-0
lib/tasks/gitlab_status.rake
lib/tasks/gitlab_status.rake
+0
-58
lib/tasks/gitolite_rebuild.rake
lib/tasks/gitolite_rebuild.rake
+0
-18
lib/tasks/update_hooks.rake
lib/tasks/update_hooks.rake
+0
-15
No files found.
.gitignore
View file @
43f5df21
...
@@ -17,4 +17,5 @@ Vagrantfile
...
@@ -17,4 +17,5 @@ Vagrantfile
config/gitlab.yml
config/gitlab.yml
config/database.yml
config/database.yml
config/initializers/omniauth.rb
config/initializers/omniauth.rb
config/unicorn.rb
db/data.yml
db/data.yml
CHANGELOG
View file @
43f5df21
v 2.4.0
- Accept merge request
v 2.3.1
- Issues pagination
- ssl fixes
- Merge Request pagination
v 2.3.0
v 2.3.0
- Dashboard r1
- Dashboard r1
- Search r1
- Search r1
...
...
README.md
View file @
43f5df21
...
@@ -12,7 +12,7 @@ GitLab is a free project and repository management application
...
@@ -12,7 +12,7 @@ GitLab is a free project and repository management application
## Requirements
## Requirements
*
Ubuntu/Debian
*
Ubuntu/Debian
*
ruby 1.9.2
*
ruby 1.9.2
+
*
mysql or sqlite
*
mysql or sqlite
*
git
*
git
*
gitolite
*
gitolite
...
...
VERSION
View file @
43f5df21
2.
3.0
2.
4.0pre
doc/installation.md
View file @
43f5df21
...
@@ -159,12 +159,11 @@ Permissions:
...
@@ -159,12 +159,11 @@ Permissions:
#### Setup DB
#### Setup DB
sudo -u gitlab bundle exec rake db:setup RAILS_ENV=production
sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production
sudo -u gitlab bundle exec rake db:seed_fu RAILS_ENV=production
Checking status:
Checking status:
sudo -u gitlab bundle exec rake gitlab
_
status RAILS_ENV=production
sudo -u gitlab bundle exec rake gitlab
:app:
status RAILS_ENV=production
# OUTPUT EXAMPLE
# OUTPUT EXAMPLE
...
...
lib/tasks/dev/repo.rake
0 → 100644
View file @
43f5df21
namespace
:dev
do
desc
"Prepare for development (run dev_user.sh first)"
task
:repos
=>
:environment
do
key
=
`sudo -u gitlabdev -H cat /home/gitlabdev/.ssh/id_rsa.pub`
raise
"
\n
*** Run ./lib/tasks/dev/user.sh first ***
\n
"
if
key
.
empty?
Key
.
create
(
:user_id
=>
User
.
first
,
:key
=>
key
,
:title
=>
"gitlabdev"
)
puts
"
\n
*** Clone diaspora from github"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev; git clone git://github.com/diaspora/diaspora.git /home/gitlabdev/diaspora"`
puts
"
\n
*** Push diaspora source to gitlab"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev/diaspora; git remote add local git@localhost:diaspora.git; git push local master; git push local --tags; git checkout -b api origin/api; git push local api; git checkout -b heroku origin/heroku; git push local heroku"`
puts
"
\n
*** Clone rails from github"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev; git clone git://github.com/rails/rails.git /home/gitlabdev/rails"`
puts
"
\n
*** Push rails source to gitlab"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev/rails; git remote add local git@localhost:ruby_on_rails.git; git push local master; git push local --tags"`
puts
"
\n
*** Clone rubinius from github"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev; git clone git://github.com/rubinius/rubinius.git /home/gitlabdev/rubinius"`
puts
"
\n
*** Push rubinius source to gitlab"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev/rubinius; git remote add local git@localhost:rubinius.git; git push local master; git push local --tags"`
end
end
lib/tasks/dev
_
user.sh
→
lib/tasks/dev
/
user.sh
View file @
43f5df21
File moved
lib/tasks/dev_repo.rake
deleted
100644 → 0
View file @
c40c627a
desc
"Prepare for development"
task
:dev_repo
=>
:environment
do
key
=
`sudo -u gitlabdev -H cat /home/gitlabdev/.ssh/id_rsa.pub`
raise
"
\n
*** Run ./lib/tasks/dev_user.sh first ***
\n
"
if
key
.
empty?
Key
.
create
(
:user_id
=>
User
.
first
,
:key
=>
key
,
:title
=>
"gitlabdev"
)
puts
"
\n
*** Clone diaspora from github"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev; git clone git://github.com/diaspora/diaspora.git /home/gitlabdev/diaspora"`
puts
"
\n
*** Push diaspora source to gitlab"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev/diaspora; git remote add local git@localhost:diaspora.git; git push local master; git push local --tags; git checkout -b api origin/api; git push local api; git checkout -b heroku origin/heroku; git push local heroku"`
puts
"
\n
*** Clone rails from github"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev; git clone git://github.com/rails/rails.git /home/gitlabdev/rails"`
puts
"
\n
*** Push rails source to gitlab"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev/rails; git remote add local git@localhost:ruby_on_rails.git; git push local master; git push local --tags"`
puts
"
\n
*** Clone rubinius from github"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev; git clone git://github.com/rubinius/rubinius.git /home/gitlabdev/rubinius"`
puts
"
\n
*** Push rubinius source to gitlab"
`sudo -u gitlabdev -H sh -c "cd /home/gitlabdev/rubinius; git remote add local git@localhost:rubinius.git; git push local master; git push local --tags"`
end
lib/tasks/gitlab/gitolite_rebuild.rake
0 → 100644
View file @
43f5df21
namespace
:gitlab
do
namespace
:gitolite
do
desc
"GITLAB | Rebuild each project at gitolite config"
task
:update_repos
=>
:environment
do
puts
"Starting Projects"
Project
.
find_each
(
:batch_size
=>
100
)
do
|
project
|
puts
puts
"===
#{
project
.
name
}
"
project
.
update_repository
puts
end
puts
"Done with projects"
end
desc
"GITLAB | Rebuild each key at gitolite config"
task
:update_keys
=>
:environment
do
puts
"Starting Key"
Key
.
find_each
(
:batch_size
=>
100
)
do
|
key
|
key
.
update_repository
print
'.'
end
puts
"Done with keys"
end
end
end
lib/tasks/gitlab/setup.rake
0 → 100644
View file @
43f5df21
namespace
:gitlab
do
namespace
:app
do
desc
"GITLAB | Setup production application"
task
:setup
=>
[
'db:setup'
,
'db:seed_fu'
]
end
end
lib/tasks/gitlab/status.rake
0 → 100644
View file @
43f5df21
namespace
:gitlab
do
namespace
:app
do
desc
"GITLAB | Check gitlab installation status"
task
:status
=>
:environment
do
puts
"Starting diagnostic"
print
"config/database.yml............"
if
File
.
exists?
(
File
.
join
Rails
.
root
,
"config"
,
"database.yml"
)
puts
"exists"
.
green
else
puts
"missing"
.
red
return
end
print
"config/gitlab.yml............"
if
File
.
exists?
(
File
.
join
Rails
.
root
,
"config"
,
"gitlab.yml"
)
puts
"exists"
.
green
else
puts
"missing"
.
red
return
end
GIT_HOST
=
YAML
.
load_file
(
"
#{
Rails
.
root
}
/config/gitlab.yml"
)[
"git_host"
]
print
"/home/git/repositories/............"
if
File
.
exists?
(
GIT_HOST
[
'base_path'
])
puts
"exists"
.
green
else
puts
"missing"
.
red
return
end
print
"/home/git/repositories/ is writable?............"
if
File
.
stat
(
GIT_HOST
[
'base_path'
]).
writable?
puts
"YES"
.
green
else
puts
"NO"
.
red
return
end
begin
`git clone
#{
GIT_HOST
[
"admin_uri"
]
}
/tmp/gitolite_gitlab_test`
FileUtils
.
rm_rf
(
"/tmp/gitolite_gitlab_test"
)
print
"Can clone gitolite-admin?............"
puts
"YES"
.
green
rescue
print
"Can clone gitolite-admin?............"
puts
"NO"
.
red
return
end
print
"UMASK for .gitolite.rc is 0007? ............"
unless
open
(
"
#{
GIT_HOST
[
'base_path'
]
}
/../.gitolite.rc"
).
grep
(
/REPO_UMASK = 0007/
).
empty?
puts
"YES"
.
green
else
puts
"NO"
.
red
return
end
puts
"
\n
Finished"
end
end
end
lib/tasks/gitlab/update_hooks.rake
0 → 100644
View file @
43f5df21
namespace
:gitlab
do
namespace
:gitolite
do
desc
"GITLAB | Rewrite hooks for repos"
task
:update_hooks
=>
:environment
do
puts
"Starting Projects"
Project
.
find_each
(
:batch_size
=>
100
)
do
|
project
|
begin
if
project
.
commit
project
.
write_hooks
print
"."
.
green
end
rescue
Exception
=>
e
print
e
.
message
.
red
end
end
puts
"
\n
Done with projects"
end
end
end
lib/tasks/gitlab_status.rake
deleted
100644 → 0
View file @
c40c627a
desc
"Check gitlab installation status"
task
:gitlab_status
=>
:environment
do
puts
"Starting diagnostic"
print
"config/database.yml............"
if
File
.
exists?
(
File
.
join
Rails
.
root
,
"config"
,
"database.yml"
)
puts
"exists"
.
green
else
puts
"missing"
.
red
return
end
print
"config/gitlab.yml............"
if
File
.
exists?
(
File
.
join
Rails
.
root
,
"config"
,
"gitlab.yml"
)
puts
"exists"
.
green
else
puts
"missing"
.
red
return
end
GIT_HOST
=
YAML
.
load_file
(
"
#{
Rails
.
root
}
/config/gitlab.yml"
)[
"git_host"
]
print
"/home/git/repositories/............"
if
File
.
exists?
(
GIT_HOST
[
'base_path'
])
puts
"exists"
.
green
else
puts
"missing"
.
red
return
end
print
"/home/git/repositories/ is writable?............"
if
File
.
stat
(
GIT_HOST
[
'base_path'
]).
writable?
puts
"YES"
.
green
else
puts
"NO"
.
red
return
end
begin
`git clone
#{
GIT_HOST
[
"admin_uri"
]
}
/tmp/gitolite_gitlab_test`
FileUtils
.
rm_rf
(
"/tmp/gitolite_gitlab_test"
)
print
"Can clone gitolite-admin?............"
puts
"YES"
.
green
rescue
print
"Can clone gitolite-admin?............"
puts
"NO"
.
red
return
end
print
"UMASK for .gitolite.rc is 0007? ............"
unless
open
(
"
#{
GIT_HOST
[
'base_path'
]
}
/../.gitolite.rc"
).
grep
(
/REPO_UMASK = 0007/
).
empty?
puts
"YES"
.
green
else
puts
"NO"
.
red
return
end
puts
"
\n
Finished"
end
lib/tasks/gitolite_rebuild.rake
deleted
100644 → 0
View file @
c40c627a
desc
"Rebuild each project at gitolite config"
task
:gitolite_rebuild
=>
:environment
do
puts
"Starting Projects"
Project
.
find_each
(
:batch_size
=>
100
)
do
|
project
|
puts
puts
"===
#{
project
.
name
}
"
project
.
update_repository
puts
end
puts
"Done with projects"
puts
"Starting Key"
Key
.
find_each
(
:batch_size
=>
100
)
do
|
project
|
project
.
update_repository
print
'.'
end
puts
"Done with keys"
end
lib/tasks/update_hooks.rake
deleted
100644 → 0
View file @
c40c627a
desc
"Rewrite hooks for repos"
task
:update_hooks
=>
:environment
do
puts
"Starting Projects"
Project
.
find_each
(
:batch_size
=>
100
)
do
|
project
|
begin
if
project
.
commit
project
.
write_hooks
print
"."
.
green
end
rescue
Exception
=>
e
print
e
.
message
.
red
end
end
puts
"
\n
Done with projects"
end
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