Commit fddc0c29aa8d63fce45b450902f27f82dfba5231
1 parent
7b97e304
Exists in
master
and in
4 other branches
add help page for gitlab specific rake tasks
Showing
7 changed files
with
275 additions
and
0 deletions
Show diff stats
app/views/help/index.html.haml
... | ... | @@ -0,0 +1,55 @@ |
1 | +%h3.page_title GitLab Rake Tasks | |
2 | +.back_link | |
3 | + = link_to help_path do | |
4 | + ← to index | |
5 | +%hr | |
6 | + | |
7 | +%p.slead | |
8 | + GitLab provides some specific rake tasks to enable special features or perform maintenance tasks. | |
9 | + | |
10 | +%ul.nav.nav-tabs.log-tabs | |
11 | + %li.active | |
12 | + = link_to "Features", "#features", 'data-toggle' => 'tab' | |
13 | + %li | |
14 | + = link_to "Maintenance", "#maintenance", 'data-toggle' => 'tab' | |
15 | + %li | |
16 | + = link_to "User Management", "#user_management", 'data-toggle' => 'tab' | |
17 | + %li | |
18 | + = link_to "Backup & Restore", "#backup_restore", 'data-toggle' => 'tab' | |
19 | + | |
20 | +.tab-content | |
21 | + .tab-pane.active#features | |
22 | + .file_holder | |
23 | + .file_title | |
24 | + %i.icon-file | |
25 | + Features | |
26 | + .file_content.wiki | |
27 | + = preserve do | |
28 | + = markdown File.read(Rails.root.join("doc", "raketasks", "features.md")) | |
29 | + | |
30 | + .tab-pane#maintenance | |
31 | + .file_holder | |
32 | + .file_title | |
33 | + %i.icon-file | |
34 | + Maintenance | |
35 | + .file_content.wiki | |
36 | + = preserve do | |
37 | + = markdown File.read(Rails.root.join("doc", "raketasks", "maintenance.md")) | |
38 | + | |
39 | + .tab-pane#user_management | |
40 | + .file_holder | |
41 | + .file_title | |
42 | + %i.icon-file | |
43 | + User Management | |
44 | + .file_content.wiki | |
45 | + = preserve do | |
46 | + = markdown File.read(Rails.root.join("doc", "raketasks", "user_management.md")) | |
47 | + | |
48 | + .tab-pane#backup_restore | |
49 | + .file_holder | |
50 | + .file_title | |
51 | + %i.icon-file | |
52 | + Backup & Restore | |
53 | + .file_content.wiki | |
54 | + = preserve do | |
55 | + = markdown File.read(Rails.root.join("doc", "raketasks", "backup_restore.md")) | ... | ... |
config/routes.rb
... | ... | @@ -0,0 +1,82 @@ |
1 | +### Create a backup of the GitLab system | |
2 | + | |
3 | +Creates a backup archive of the database and all repositories. This archive will be saved in backup_path (see `config/gitlab.yml`). | |
4 | +The filename will be `[TIMESTAMP]_gitlab_backup.tar`. This timestamp can be used to restore an specific backup. | |
5 | + | |
6 | +``` | |
7 | +bundle exec rake gitlab:app:backup_create | |
8 | +``` | |
9 | + | |
10 | +Example output: | |
11 | + | |
12 | +``` | |
13 | +Dumping database tables: | |
14 | +- Dumping table events... [DONE] | |
15 | +- Dumping table issues... [DONE] | |
16 | +- Dumping table keys... [DONE] | |
17 | +- Dumping table merge_requests... [DONE] | |
18 | +- Dumping table milestones... [DONE] | |
19 | +- Dumping table namespaces... [DONE] | |
20 | +- Dumping table notes... [DONE] | |
21 | +- Dumping table projects... [DONE] | |
22 | +- Dumping table protected_branches... [DONE] | |
23 | +- Dumping table schema_migrations... [DONE] | |
24 | +- Dumping table services... [DONE] | |
25 | +- Dumping table snippets... [DONE] | |
26 | +- Dumping table taggings... [DONE] | |
27 | +- Dumping table tags... [DONE] | |
28 | +- Dumping table users... [DONE] | |
29 | +- Dumping table users_projects... [DONE] | |
30 | +- Dumping table web_hooks... [DONE] | |
31 | +- Dumping table wikis... [DONE] | |
32 | +Dumping repositories: | |
33 | +- Dumping repository abcd... [DONE] | |
34 | +- Dumping repository gitolite-admin.git... [DONE] | |
35 | +Creating backup archive: $TIMESTAMP_gitlab_backup.tar [DONE] | |
36 | +Deleting tmp directories...[DONE] | |
37 | +Deleting old backups... [SKIPPING] | |
38 | +``` | |
39 | + | |
40 | +### Restore a previously created backup | |
41 | + | |
42 | +``` | |
43 | +bundle exec rake gitlab:app:backup_restore | |
44 | +``` | |
45 | + | |
46 | +Options: | |
47 | + | |
48 | +``` | |
49 | +BACKUP=timestamp_of_backup (required if more than one backup exists) | |
50 | +``` | |
51 | + | |
52 | +Example output: | |
53 | + | |
54 | +``` | |
55 | +Unpacking backup... [DONE] | |
56 | +Restoring database tables: | |
57 | +-- create_table("events", {:force=>true}) | |
58 | + -> 0.2231s | |
59 | +[...] | |
60 | +- Loading fixture events...[DONE] | |
61 | +- Loading fixture issues...[DONE] | |
62 | +- Loading fixture keys...[SKIPPING] | |
63 | +- Loading fixture merge_requests...[DONE] | |
64 | +- Loading fixture milestones...[DONE] | |
65 | +- Loading fixture namespaces...[DONE] | |
66 | +- Loading fixture notes...[DONE] | |
67 | +- Loading fixture projects...[DONE] | |
68 | +- Loading fixture protected_branches...[SKIPPING] | |
69 | +- Loading fixture schema_migrations...[DONE] | |
70 | +- Loading fixture services...[SKIPPING] | |
71 | +- Loading fixture snippets...[SKIPPING] | |
72 | +- Loading fixture taggings...[SKIPPING] | |
73 | +- Loading fixture tags...[SKIPPING] | |
74 | +- Loading fixture users...[DONE] | |
75 | +- Loading fixture users_projects...[DONE] | |
76 | +- Loading fixture web_hooks...[SKIPPING] | |
77 | +- Loading fixture wikis...[SKIPPING] | |
78 | +Restoring repositories: | |
79 | +- Restoring repository abcd... [DONE] | |
80 | +- Restoring repository gitolite-admin.git... [DONE] | |
81 | +Deleting tmp directories...[DONE] | |
82 | +``` | ... | ... |
... | ... | @@ -0,0 +1,36 @@ |
1 | +### Enable usernames and namespaces for user projects | |
2 | + | |
3 | +This command will enable the namespace feature introduced in v4.0. It will move every project in its namespace folder. | |
4 | + | |
5 | +Note: | |
6 | + | |
7 | +* Because the **repository location will change**, you will need to **update all your git url's** to point to the new location. | |
8 | +* Username can be changed at [Profile / Account](/profile/account) | |
9 | + | |
10 | +**Example:** | |
11 | + | |
12 | +Old path: `git@example.org:myrepo.git` | |
13 | +New path: `git@example.org:username/myrepo.git` or `git@example.org:groupname/myrepo.git` | |
14 | + | |
15 | +``` | |
16 | +bundle exec rake gitlab:activate_namespaces | |
17 | +``` | |
18 | + | |
19 | + | |
20 | +### Enable auto merge | |
21 | + | |
22 | +This command will enable the auto merge feature. After this you will be able to **merge a merge request** via GitLab and use the **online editor**. | |
23 | + | |
24 | +``` | |
25 | +bundle exec rake gitlab:app:enable_automerge | |
26 | +``` | |
27 | + | |
28 | +Example output: | |
29 | + | |
30 | +``` | |
31 | +Creating satellite for abcd.git | |
32 | +[git clone output] | |
33 | +Creating satellite for abcd2.git | |
34 | +[git clone output] | |
35 | +done | |
36 | +``` | ... | ... |
... | ... | @@ -0,0 +1,82 @@ |
1 | +### Setup production application | |
2 | + | |
3 | +Runs the following rake tasks: | |
4 | + | |
5 | +* db:setup (Create the database, load the schema, and initialize with the seed data) | |
6 | +* db:seed_fu (Loads seed data for the current environment.) | |
7 | +* gitlab:app:enable_automerge (see "Features") | |
8 | + | |
9 | +``` | |
10 | +bundle exec rake gitlab:app:setup | |
11 | +``` | |
12 | + | |
13 | + | |
14 | +### Check GitLab installation status | |
15 | + | |
16 | +[Trouble-Shooting-Guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide) | |
17 | + | |
18 | +``` | |
19 | +bundle exec rake gitlab:app:status | |
20 | +``` | |
21 | + | |
22 | +Example output: | |
23 | + | |
24 | +``` | |
25 | +config/database.yml............exists | |
26 | +config/gitlab.yml............exists | |
27 | +/home/git/repositories/............exists | |
28 | +/home/git/repositories/ is writable?............YES | |
29 | +Can clone gitolite-admin?............YES | |
30 | +Can git commit?............YES | |
31 | +UMASK for .gitolite.rc is 0007? ............YES | |
32 | +/home/git/.gitolite/hooks/common/post-receive exists? ............YES | |
33 | + | |
34 | +Validating projects repositories: | |
35 | +* abcd.....post-receive file ok | |
36 | +* abcdtest.....post-receive file missing | |
37 | + | |
38 | +Finished | |
39 | + | |
40 | +``` | |
41 | + | |
42 | + | |
43 | +### Rebuild each key at gitolite config | |
44 | + | |
45 | +This will send all users ssh public keys to gitolite and grant them access (based on their permission) to their projects. | |
46 | + | |
47 | +``` | |
48 | +bundle exec rake gitlab:gitolite:update_keys | |
49 | +``` | |
50 | + | |
51 | + | |
52 | +### Rebuild each project at gitolite config | |
53 | + | |
54 | +This makes sure that all projects are present in gitolite and can be accessed. | |
55 | + | |
56 | +``` | |
57 | +bundle exec rake gitlab:gitolite:update_repos | |
58 | +``` | |
59 | + | |
60 | +### Import bare repositories into GitLab project instance | |
61 | + | |
62 | +Notes: | |
63 | + | |
64 | +* project owner will be a first admin | |
65 | +* existing projects will be skipped | |
66 | + | |
67 | +How to use: | |
68 | + | |
69 | +1. copy your bare repos under git base_path (see `config/gitlab.yml` git_host -> base_path) | |
70 | +2. run the command below | |
71 | + | |
72 | +``` | |
73 | +bundle exec rake gitlab:import:repos RAILS_ENV=production | |
74 | +``` | |
75 | + | |
76 | +Example output: | |
77 | + | |
78 | +``` | |
79 | +Processing abcd.git | |
80 | + * Created abcd (abcd.git) | |
81 | +[...] | |
82 | +``` | ... | ... |
... | ... | @@ -0,0 +1,16 @@ |
1 | +### Add user to as a developer to all projects | |
2 | + | |
3 | +``` | |
4 | +bundle exec rake add_user_to_project_teams[username@domain.tld] | |
5 | +``` | |
6 | + | |
7 | + | |
8 | +### Add all users to all projects | |
9 | + | |
10 | +Notes: | |
11 | + | |
12 | +* admin users are added as masters | |
13 | + | |
14 | +``` | |
15 | +bundle exec rake add_users_to_project_teams | |
16 | +``` | ... | ... |