OSDN Git Service

Add RAILS_ENV to rake docs
[wvm/gitlab.git] / doc / raketasks / maintenance.md
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 RAILS_ENV=production
11 ```
12
13
14 ### Gather information about GitLab and the system it runs on
15
16 This command gathers information about your GitLab installation and the System
17 it runs on. These may be useful when asking for help or reporting issues.
18
19 ```
20 bundle exec rake gitlab:env:info RAILS_ENV=production
21 ```
22
23 Example output:
24
25 ```
26 System information
27 System:         Debian 6.0.6
28 Current User:   gitlab
29 Using RVM:      yes
30 RVM Version:    1.17.2
31 Ruby Version:   ruby-1.9.3-p327
32 Gem Version:    1.8.24
33 Bundler Version:1.2.3
34 Rake Version:   10.0.1
35
36 GitLab information
37 Version:        3.1.0
38 Resivion:       fd5141d
39 Directory:      /home/gitlab/gitlab
40 DB Adapter:     mysql2
41 URL:            http://localhost:3000
42 HTTP Clone URL: http://localhost:3000/some-project.git
43 SSH Clone URL:  git@localhost:some-project.git
44 Using LDAP:     no
45 Using Omniauth: no
46
47 Gitolite information
48 Version:        v3.04-4-g4524f01
49 Admin URI:      git@localhost:gitolite-admin
50 Admin Key:      gitlab
51 Repositories:   /home/git/repositories/
52 Hooks:          /home/git/.gitolite/hooks/
53 Git:            /usr/bin/git
54 ```
55
56
57 ### Check GitLab configuration
58
59 Runs the following rake tasks:
60
61 * gitlab:env:check
62 * gitlab:gitolite:check
63 * gitlab:resque:check
64 * gitlab:app:check
65
66 It will check that each component was setup according to the installation guide and suggest fixes for issues found.
67
68 You may also have a look at our [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide).
69
70 ```
71 bundle exec rake gitlab:check RAILS_ENV=production
72 ```
73
74 Example output:
75
76 ```
77 Checking Environment ...
78
79 gitlab user is in git group? ... yes
80 Has no "-e" in ~git/.profile ... yes
81 Git configured for gitlab user? ... yes
82 Has python2? ... yes
83 python2 is supported version? ... yes
84
85 Checking Environment ... Finished
86
87 Checking Gitolite ...
88
89 Using recommended version ... yes
90 Repo umask is 0007 in .gitolite.rc? ... yes
91 Allow all Git config keys in .gitolite.rc ... yes
92 Config directory exists? ... yes
93 Config directory owned by git:git? ... yes
94 Config directory access is drwxr-x---? ... yes
95 Repo base directory exists? ... yes
96 Repo base owned by git:git? ... yes
97 Repo base access is drwsrws---? ... yes
98 Can clone gitolite-admin? ... yes
99 Can commit to gitolite-admin? ... yes
100 post-receive hook exists? ... yes
101 post-receive hook up-to-date? ... yes
102 post-receive hooks in repos are links: ...
103 GitLab ... ok
104 Non-Ascii Files Test ... ok
105 Touch Commit Test ... ok
106 Without Master Test ... ok
107 Git config in repos: ...
108 GitLab ... ok
109 Non-Ascii Files Test ... ok
110 Touch Commit Test ... ok
111 Without Master Test ... ok
112
113 Checking Gitolite ... Finished
114
115 Checking Resque ...
116
117 Running? ... yes
118
119 Checking Resque ... Finished
120
121 Checking GitLab ...
122
123 Database config exists? ... yes
124 Database is not SQLite ... yes
125 All migrations up? ... yes
126 GitLab config exists? ... yes
127 GitLab config not outdated? ... yes
128 Log directory writable? ... yes
129 Tmp directory writable? ... yes
130 Init script exists? ... yes
131 Init script up-to-date? ... yes
132 Projects have satellites? ...
133 GitLab ... yes
134 Non-Ascii Files Test ... yes
135 Touch Commit Test ... yes
136 Without Master Test ... yes
137
138 Checking GitLab ... Finished
139 ```
140
141
142 ### (Re-)Create satellite repos
143
144 This will create satellite repos for all your projects.
145 If necessary, remove the `tmp/repo_satellites` directory and rerun the command below.
146
147 ```
148 bundle exec rake gitlab:satellites:create RAILS_ENV=production
149 ```
150
151
152 ### Rebuild each key at gitolite config
153
154 This will send all users ssh public keys to gitolite and grant them access (based on their permission) to their projects.
155
156 ```
157 bundle exec rake gitlab:gitolite:update_keys RAILS_ENV=production
158 ```
159
160
161 ### Rebuild each project at gitolite config
162
163 This makes sure that all projects are present in gitolite and can be accessed.
164
165 ```
166 bundle exec rake gitlab:gitolite:update_repos RAILS_ENV=production
167 ```
168
169 ### Import bare repositories into GitLab project instance
170
171 Notes:
172
173 * project owner will be a first admin
174 * existing projects will be skipped
175
176 How to use:
177
178 1. copy your bare repos under git base_path (see `config/gitlab.yml` git_host -> base_path)
179 2. run the command below
180
181 ```
182 bundle exec rake gitlab:import:repos RAILS_ENV=production
183 ```
184
185 Example output:
186
187 ```
188 Processing abcd.git
189  * Created abcd (abcd.git)
190 [...]
191 ```