Commit fd86bf4ae9ccfaab6cf4dfba38de6c7e0b80ec9f
Committed by
Dmitriy Zaporozhets
1 parent
5ff6fadc
Exists in
master
and in
4 other branches
Decouple requirements and install
Showing
3 changed files
with
117 additions
and
112 deletions
Show diff stats
... | ... | @@ -0,0 +1,75 @@ |
1 | +# Databases: | |
2 | + | |
3 | +GitLab use mysql as default database but you are free to use PostgreSQL or SQLite. | |
4 | + | |
5 | + | |
6 | +## SQLite | |
7 | + | |
8 | + sudo apt-get install -y sqlite3 libsqlite3-dev | |
9 | + | |
10 | +## MySQL | |
11 | + | |
12 | + sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev | |
13 | + | |
14 | + # Login to MySQL | |
15 | + $ mysql -u root -p | |
16 | + | |
17 | + # Create the GitLab production database | |
18 | + mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; | |
19 | + | |
20 | + # Create the MySQL User change $password to a real password | |
21 | + mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; | |
22 | + | |
23 | + # Grant proper permissions to the MySQL User | |
24 | + mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; | |
25 | + | |
26 | + | |
27 | +## PostgreSQL | |
28 | + | |
29 | + sudo apt-get install -y postgresql-9.2 postgresql-server-dev-9.2 | |
30 | + | |
31 | + # Connect to database server | |
32 | + sudo -u postgres psql -d template1 | |
33 | + | |
34 | + # Add a user called gitlab. Change $password to a real password | |
35 | + template1=# CREATE USER gitlab WITH PASSWORD '$password'; | |
36 | + | |
37 | + # Create the GitLab production database | |
38 | + template1=# CREATE DATABASE IF NOT EXISTS gitlabhq_production; | |
39 | + | |
40 | + # Grant all privileges on database | |
41 | + template1=# GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab; | |
42 | + | |
43 | + # Quit from PostgreSQL server | |
44 | + template1=# \q | |
45 | + | |
46 | + # Try connect to new database | |
47 | + $ su - gitlab | |
48 | + $ psql -d gitlabhq_production -U gitlab | |
49 | + | |
50 | + | |
51 | + | |
52 | +#### Select the database you want to use | |
53 | + | |
54 | + # SQLite | |
55 | + sudo -u gitlab cp config/database.yml.sqlite config/database.yml | |
56 | + | |
57 | + # Mysql | |
58 | + sudo -u gitlab cp config/database.yml.mysql config/database.yml | |
59 | + | |
60 | + # PostgreSQL | |
61 | + sudo -u gitlab cp config/database.yml.postgres config/database.yml | |
62 | + | |
63 | + # make sure to update username/password in config/database.yml | |
64 | + | |
65 | +#### Install gems | |
66 | + | |
67 | + # mysql | |
68 | + sudo -u gitlab -H bundle install --without development test sqlite postgres --deployment | |
69 | + | |
70 | + # or postgres | |
71 | + sudo -u gitlab -H bundle install --without development test sqlite mysql --deployment | |
72 | + | |
73 | + # or sqlite | |
74 | + sudo -u gitlab -H bundle install --without development test mysql postgres --deployment | |
75 | + | ... | ... |
doc/installation.md
1 | -## Platform requirements: | |
2 | - | |
3 | -**The project is designed for the Linux operating system.** | |
4 | - | |
5 | -It may work on FreeBSD and Mac OS, but we don't test our application for these systems and can't guarantee stability and full functionality. | |
6 | - | |
7 | -We officially support (recent versions of) these Linux distributions: | |
8 | - | |
9 | -- Ubuntu Linux | |
10 | -- Debian/GNU Linux | |
11 | - | |
12 | -It should work on: | |
13 | - | |
14 | -- Fedora | |
15 | -- CentOs | |
16 | -- RedHat | |
17 | - | |
18 | -You might have some luck using these, but no guarantees: | |
19 | - | |
20 | - - MacOS X | |
21 | - - FreeBSD | |
22 | - | |
23 | -GitLab does **not** run on Windows and we have no plans of making GitLab compatible. | |
24 | - | |
25 | - | |
26 | -## Hardware: | |
27 | - | |
28 | -We recommend to use server with at least 1GB RAM for gitlab instance. | |
29 | - | |
30 | - | |
31 | -## This installation guide created for Debian/Ubuntu and properly tested. | |
1 | +_This installation guide created for Debian/Ubuntu and properly tested._ | |
32 | 2 | |
3 | +_Checkout requirements before setup_ | |
33 | 4 | |
34 | 5 | ### IMPORTANT |
35 | 6 | |
... | ... | @@ -39,6 +10,7 @@ Only create a GitHub Issue if you want a specific part of this installation guid |
39 | 10 | |
40 | 11 | Also read the [Read this before you submit an issue](https://github.com/gitlabhq/gitlabhq/wiki/Read-this-before-you-submit-an-issue) wiki page. |
41 | 12 | |
13 | +- - - | |
42 | 14 | |
43 | 15 | # Basic setup |
44 | 16 | |
... | ... | @@ -103,12 +75,9 @@ Create user for GitLab: |
103 | 75 | # ubuntu/debian |
104 | 76 | sudo adduser --disabled-login --gecos 'gitlab system' gitlab |
105 | 77 | |
106 | -Add your user to the `git` group: | |
78 | +Add your users to groups: | |
107 | 79 | |
108 | 80 | sudo usermod -a -G git gitlab |
109 | - | |
110 | -Add `git` user to `gitlab` group: | |
111 | - | |
112 | 81 | sudo usermod -a -G gitlab git |
113 | 82 | |
114 | 83 | Generate key: |
... | ... | @@ -190,12 +159,19 @@ and ensure you have followed all of the above steps carefully. |
190 | 159 | cd gitlab |
191 | 160 | |
192 | 161 | # Rename config files |
162 | + # | |
193 | 163 | sudo -u gitlab cp config/gitlab.yml.example config/gitlab.yml |
194 | 164 | |
195 | 165 | # Copy mysql db config |
166 | + # | |
196 | 167 | # make sure to update username/password in config/database.yml |
168 | + # | |
197 | 169 | sudo -u gitlab cp config/database.yml.mysql config/database.yml |
198 | 170 | |
171 | + # Copy unicorn config | |
172 | + # | |
173 | + sudo -u gitlab cp config/unicorn.rb.example config/unicorn.rb | |
174 | + | |
199 | 175 | #### Install gems |
200 | 176 | |
201 | 177 | cd /home/gitlab/gitlab |
... | ... | @@ -208,9 +184,6 @@ and ensure you have followed all of the above steps carefully. |
208 | 184 | |
209 | 185 | sudo -u gitlab bundle exec rake gitlab:app:setup RAILS_ENV=production |
210 | 186 | |
211 | -#### Copy unicorn config | |
212 | - | |
213 | - sudo -u gitlab cp config/unicorn.rb.example config/unicorn.rb | |
214 | 187 | |
215 | 188 | #### Setup GitLab hooks |
216 | 189 | |
... | ... | @@ -275,7 +248,7 @@ GitLab autostart: |
275 | 248 | sudo /etc/init.d/nginx restart |
276 | 249 | |
277 | 250 | |
278 | -# Done! Visit **YOUR_SERVER_FQDN** for gitlab instance | |
251 | +# Done! Visit YOUR_SERVER for gitlab instance | |
279 | 252 | |
280 | 253 | You can login via web using admin generated with setup: |
281 | 254 | |
... | ... | @@ -283,6 +256,8 @@ You can login via web using admin generated with setup: |
283 | 256 | 5iveL!fe |
284 | 257 | |
285 | 258 | |
259 | +- - - | |
260 | + | |
286 | 261 | |
287 | 262 | # Advanced setup tips: |
288 | 263 | |
... | ... | @@ -318,76 +293,3 @@ a different host, you can configure its connection string in the |
318 | 293 | |
319 | 294 | **Ok - we have a working application now. ** |
320 | 295 | **But keep going - there are some things that should be done ** |
321 | - | |
322 | - | |
323 | -# Database | |
324 | - | |
325 | -## SQLite | |
326 | - | |
327 | - sudo apt-get install -y sqlite3 libsqlite3-dev | |
328 | - | |
329 | -## MySQL | |
330 | - | |
331 | - sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev | |
332 | - | |
333 | - # Login to MySQL | |
334 | - $ mysql -u root -p | |
335 | - | |
336 | - # Create the GitLab production database | |
337 | - mysql> CREATE DATABASE IF NOT EXISTS `gitlabhq_production` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`; | |
338 | - | |
339 | - # Create the MySQL User change $password to a real password | |
340 | - mysql> CREATE USER 'gitlab'@'localhost' IDENTIFIED BY '$password'; | |
341 | - | |
342 | - # Grant proper permissions to the MySQL User | |
343 | - mysql> GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER ON `gitlabhq_production`.* TO 'gitlab'@'localhost'; | |
344 | - | |
345 | - | |
346 | -## PostgreSQL | |
347 | - | |
348 | - sudo apt-get install -y postgresql-9.2 postgresql-server-dev-9.2 | |
349 | - | |
350 | - # Connect to database server | |
351 | - sudo -u postgres psql -d template1 | |
352 | - | |
353 | - # Add a user called gitlab. Change $password to a real password | |
354 | - template1=# CREATE USER gitlab WITH PASSWORD '$password'; | |
355 | - | |
356 | - # Create the GitLab production database | |
357 | - template1=# CREATE DATABASE IF NOT EXISTS gitlabhq_production; | |
358 | - | |
359 | - # Grant all privileges on database | |
360 | - template1=# GRANT ALL PRIVILEGES ON DATABASE gitlabhq_production to gitlab; | |
361 | - | |
362 | - # Quit from PostgreSQL server | |
363 | - template1=# \q | |
364 | - | |
365 | - # Try connect to new database | |
366 | - $ su - gitlab | |
367 | - $ psql -d gitlabhq_production -U gitlab | |
368 | - | |
369 | - | |
370 | - | |
371 | -#### Select the database you want to use | |
372 | - | |
373 | - # SQLite | |
374 | - sudo -u gitlab cp config/database.yml.sqlite config/database.yml | |
375 | - | |
376 | - # Mysql | |
377 | - sudo -u gitlab cp config/database.yml.mysql config/database.yml | |
378 | - | |
379 | - # PostgreSQL | |
380 | - sudo -u gitlab cp config/database.yml.postgres config/database.yml | |
381 | - | |
382 | - # make sure to update username/password in config/database.yml | |
383 | - | |
384 | -#### Install gems | |
385 | - | |
386 | - # mysql | |
387 | - sudo -u gitlab -H bundle install --without development test sqlite postgres --deployment | |
388 | - | |
389 | - # or postgres | |
390 | - sudo -u gitlab -H bundle install --without development test sqlite mysql --deployment | |
391 | - | |
392 | - # or sqlite | |
393 | - sudo -u gitlab -H bundle install --without development test mysql postgres --deployment | ... | ... |
... | ... | @@ -0,0 +1,28 @@ |
1 | +## Platform requirements: | |
2 | + | |
3 | +**The project is designed for the Linux operating system.** | |
4 | + | |
5 | +It may work on FreeBSD and Mac OS, but we don't test our application for these systems and can't guarantee stability and full functionality. | |
6 | + | |
7 | +We officially support (recent versions of) these Linux distributions: | |
8 | + | |
9 | +- Ubuntu Linux | |
10 | +- Debian/GNU Linux | |
11 | + | |
12 | +It should work on: | |
13 | + | |
14 | +- Fedora | |
15 | +- CentOs | |
16 | +- RedHat | |
17 | + | |
18 | +You might have some luck using these, but no guarantees: | |
19 | + | |
20 | + - MacOS X | |
21 | + - FreeBSD | |
22 | + | |
23 | +GitLab does **not** run on Windows and we have no plans of making GitLab compatible. | |
24 | + | |
25 | + | |
26 | +## Hardware: | |
27 | + | |
28 | +We recommend to use server with at least 1GB RAM for gitlab instance. | ... | ... |