Commit 5c6492662ef730eef7a9122f53438c32724ae91d
1 parent
27d9ac0f
Exists in
master
and in
4 other branches
update installation docs
Showing
1 changed file
with
36 additions
and
90 deletions
Show diff stats
doc/install/installation.md
@@ -90,86 +90,32 @@ Install the Bundler Gem: | @@ -90,86 +90,32 @@ Install the Bundler Gem: | ||
90 | 90 | ||
91 | # 3. System Users | 91 | # 3. System Users |
92 | 92 | ||
93 | -Create a user for Git and Gitolite: | 93 | +Create a `git` user for Gitlab: |
94 | 94 | ||
95 | - sudo adduser \ | ||
96 | - --system \ | ||
97 | - --shell /bin/sh \ | ||
98 | - --gecos 'Git Version Control' \ | ||
99 | - --group \ | ||
100 | - --disabled-password \ | ||
101 | - --home /home/git \ | ||
102 | - git | 95 | + sudo adduser --disabled-login --gecos 'GitLab' git |
103 | 96 | ||
104 | -Create a user for GitLab: | 97 | +# 4. GitLab shell |
105 | 98 | ||
106 | - sudo adduser --disabled-login --gecos 'GitLab' gitlab | ||
107 | - | ||
108 | - # Add it to the git group | ||
109 | - sudo usermod -a -G git gitlab | ||
110 | - | ||
111 | - # Generate the SSH key | ||
112 | - sudo -u gitlab -H ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa | ||
113 | - | ||
114 | - | ||
115 | -# 4. Gitolite | ||
116 | - | ||
117 | -Clone GitLab's fork of the Gitolite source code: | 99 | + # login as git |
100 | + sudo su git | ||
118 | 101 | ||
102 | + # go to home directory | ||
119 | cd /home/git | 103 | cd /home/git |
120 | - sudo -u git -H git clone -b gl-v320 https://github.com/gitlabhq/gitolite.git /home/git/gitolite | ||
121 | - | ||
122 | -Setup Gitolite with GitLab as its admin: | ||
123 | - | ||
124 | -**Important Note:** | ||
125 | -GitLab assumes *full and unshared* control over this Gitolite installation. | ||
126 | - | ||
127 | - # Add Gitolite scripts to $PATH | ||
128 | - sudo -u git -H mkdir /home/git/bin | ||
129 | - sudo -u git -H sh -c 'printf "%b\n%b\n" "PATH=\$PATH:/home/git/bin" "export PATH" >> /home/git/.profile' | ||
130 | - sudo -u git -H sh -c 'gitolite/install -ln /home/git/bin' | ||
131 | - | ||
132 | - # Copy the gitlab user's (public) SSH key ... | ||
133 | - sudo cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub | ||
134 | - sudo chmod 0444 /home/git/gitlab.pub | ||
135 | 104 | ||
136 | - # ... and use it as the admin key for the Gitolite setup | ||
137 | - sudo -u git -H sh -c "PATH=/home/git/bin:$PATH; gitolite setup -pk /home/git/gitlab.pub" | 105 | + # clone gitlab shell |
106 | + git clone https://dzaporozhets@dev.gitlab.org/gitlab/gitlab-shell.git | ||
138 | 107 | ||
139 | -Fix the directory permissions for the configuration directory: | ||
140 | - | ||
141 | - # Make sure the Gitolite config dir is owned by git | ||
142 | - sudo chmod 750 /home/git/.gitolite/ | ||
143 | - sudo chown -R git:git /home/git/.gitolite/ | ||
144 | - | ||
145 | -Fix the directory permissions for the repositories: | ||
146 | - | ||
147 | - # Make sure the repositories dir is owned by git and it stays that way | ||
148 | - sudo chmod -R ug+rwX,o-rwx /home/git/repositories/ | ||
149 | - sudo chown -R git:git /home/git/repositories/ | ||
150 | - find /home/git/repositories -type d -print0 | sudo xargs -0 chmod g+s | 108 | + # setup |
109 | + cd gitlab-shell | ||
110 | + cp config.yml.example config.yml | ||
111 | + ./bin/install | ||
151 | 112 | ||
152 | 113 | ||
153 | ## Add domains to list to the list of known hosts | 114 | ## Add domains to list to the list of known hosts |
154 | 115 | ||
155 | - sudo -u gitlab -H ssh git@localhost | ||
156 | - sudo -u gitlab -H ssh git@YOUR_DOMAIN_NAME | ||
157 | - sudo -u gitlab -H ssh git@YOUR_GITOLITE_DOMAIN_NAME | ||
158 | - | ||
159 | - | ||
160 | -## Test if everything works so far | ||
161 | - | ||
162 | - # Clone the admin repo so SSH adds localhost to known_hosts ... | ||
163 | - # ... and to be sure your users have access to Gitolite | ||
164 | - sudo -u gitlab -H git clone git@localhost:gitolite-admin.git /tmp/gitolite-admin | ||
165 | - | ||
166 | - # If it succeeded without errors you can remove the cloned repo | ||
167 | - sudo rm -rf /tmp/gitolite-admin | ||
168 | - | ||
169 | -**Important Note:** | ||
170 | -If you can't clone the `gitolite-admin` repository: **DO NOT PROCEED WITH INSTALLATION**! | ||
171 | -Check the [Trouble Shooting Guide](https://github.com/gitlabhq/gitlab-public-wiki/wiki/Trouble-Shooting-Guide) | ||
172 | -and make sure you have followed all of the above steps carefully. | 116 | + sudo -u git -H ssh git@localhost |
117 | + sudo -u git -H ssh git@YOUR_DOMAIN_NAME | ||
118 | + sudo -u git -H ssh git@YOUR_GITOLITE_DOMAIN_NAME | ||
173 | 119 | ||
174 | 120 | ||
175 | # 5. Database | 121 | # 5. Database |
@@ -179,19 +125,19 @@ See `doc/install/databases.md` | @@ -179,19 +125,19 @@ See `doc/install/databases.md` | ||
179 | 125 | ||
180 | # 6. GitLab | 126 | # 6. GitLab |
181 | 127 | ||
182 | - # We'll install GitLab into home directory of the user "gitlab" | ||
183 | - cd /home/gitlab | 128 | + # We'll install GitLab into home directory of the user "git" |
129 | + cd /home/git | ||
184 | 130 | ||
185 | ## Clone the Source | 131 | ## Clone the Source |
186 | 132 | ||
187 | # Clone GitLab repository | 133 | # Clone GitLab repository |
188 | - sudo -u gitlab -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab | 134 | + sudo -u git -H git clone https://github.com/gitlabhq/gitlabhq.git gitlab |
189 | 135 | ||
190 | # Go to gitlab dir | 136 | # Go to gitlab dir |
191 | - cd /home/gitlab/gitlab | 137 | + cd /home/git/gitlab |
192 | 138 | ||
193 | # Checkout to stable release | 139 | # Checkout to stable release |
194 | - sudo -u gitlab -H git checkout 4-1-stable | 140 | + sudo -u git -H git checkout 4-1-stable |
195 | 141 | ||
196 | **Note:** | 142 | **Note:** |
197 | You can change `4-1-stable` to `master` if you want the *bleeding edge* version, but | 143 | You can change `4-1-stable` to `master` if you want the *bleeding edge* version, but |
@@ -199,14 +145,14 @@ do so with caution! | @@ -199,14 +145,14 @@ do so with caution! | ||
199 | 145 | ||
200 | ## Configure it | 146 | ## Configure it |
201 | 147 | ||
202 | - cd /home/gitlab/gitlab | 148 | + cd /home/git/gitlab |
203 | 149 | ||
204 | # Copy the example GitLab config | 150 | # Copy the example GitLab config |
205 | - sudo -u gitlab -H cp config/gitlab.yml.example config/gitlab.yml | 151 | + sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml |
206 | 152 | ||
207 | # Make sure to change "localhost" to the fully-qualified domain name of your | 153 | # Make sure to change "localhost" to the fully-qualified domain name of your |
208 | # host serving GitLab where necessary | 154 | # host serving GitLab where necessary |
209 | - sudo -u gitlab -H vim config/gitlab.yml | 155 | + sudo -u git -H vim config/gitlab.yml |
210 | 156 | ||
211 | # Make sure GitLab can write to the log/ and tmp/ directories | 157 | # Make sure GitLab can write to the log/ and tmp/ directories |
212 | sudo chown -R gitlab log/ | 158 | sudo chown -R gitlab log/ |
@@ -215,10 +161,10 @@ do so with caution! | @@ -215,10 +161,10 @@ do so with caution! | ||
215 | sudo chmod -R u+rwX tmp/ | 161 | sudo chmod -R u+rwX tmp/ |
216 | 162 | ||
217 | # Make directory for satellites | 163 | # Make directory for satellites |
218 | - sudo -u gitlab -H mkdir /home/gitlab/gitlab-satellites | 164 | + sudo -u git -H mkdir /home/git/gitlab-satellites |
219 | 165 | ||
220 | # Copy the example Unicorn config | 166 | # Copy the example Unicorn config |
221 | - sudo -u gitlab -H cp config/unicorn.rb.example config/unicorn.rb | 167 | + sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb |
222 | 168 | ||
223 | **Important Note:** | 169 | **Important Note:** |
224 | Make sure to edit both files to match your setup. | 170 | Make sure to edit both files to match your setup. |
@@ -226,24 +172,24 @@ Make sure to edit both files to match your setup. | @@ -226,24 +172,24 @@ Make sure to edit both files to match your setup. | ||
226 | ## Configure GitLab DB settings | 172 | ## Configure GitLab DB settings |
227 | 173 | ||
228 | # Mysql | 174 | # Mysql |
229 | - sudo -u gitlab cp config/database.yml.mysql config/database.yml | 175 | + sudo -u git cp config/database.yml.mysql config/database.yml |
230 | 176 | ||
231 | # PostgreSQL | 177 | # PostgreSQL |
232 | - sudo -u gitlab cp config/database.yml.postgresql config/database.yml | 178 | + sudo -u git cp config/database.yml.postgresql config/database.yml |
233 | 179 | ||
234 | Make sure to update username/password in config/database.yml. | 180 | Make sure to update username/password in config/database.yml. |
235 | 181 | ||
236 | ## Install Gems | 182 | ## Install Gems |
237 | 183 | ||
238 | - cd /home/gitlab/gitlab | 184 | + cd /home/git/gitlab |
239 | 185 | ||
240 | sudo gem install charlock_holmes --version '0.6.9' | 186 | sudo gem install charlock_holmes --version '0.6.9' |
241 | 187 | ||
242 | # For MySQL (note, the option says "without") | 188 | # For MySQL (note, the option says "without") |
243 | - sudo -u gitlab -H bundle install --deployment --without development test postgres | 189 | + sudo -u git -H bundle install --deployment --without development test postgres |
244 | 190 | ||
245 | # Or for PostgreSQL | 191 | # Or for PostgreSQL |
246 | - sudo -u gitlab -H bundle install --deployment --without development test mysql | 192 | + sudo -u git -H bundle install --deployment --without development test mysql |
247 | 193 | ||
248 | ## Configure Git | 194 | ## Configure Git |
249 | 195 | ||
@@ -251,8 +197,8 @@ GitLab needs to be able to commit and push changes to Gitolite. In order to do | @@ -251,8 +197,8 @@ GitLab needs to be able to commit and push changes to Gitolite. In order to do | ||
251 | that Git requires a username and email. (We recommend using the same address | 197 | that Git requires a username and email. (We recommend using the same address |
252 | used for the `email.from` setting in `config/gitlab.yml`) | 198 | used for the `email.from` setting in `config/gitlab.yml`) |
253 | 199 | ||
254 | - sudo -u gitlab -H git config --global user.name "GitLab" | ||
255 | - sudo -u gitlab -H git config --global user.email "gitlab@localhost" | 200 | + sudo -u git -H git config --global user.name "GitLab" |
201 | + sudo -u git -H git config --global user.email "gitlab@localhost" | ||
256 | 202 | ||
257 | ## Setup GitLab Hooks | 203 | ## Setup GitLab Hooks |
258 | 204 | ||
@@ -261,7 +207,7 @@ used for the `email.from` setting in `config/gitlab.yml`) | @@ -261,7 +207,7 @@ used for the `email.from` setting in `config/gitlab.yml`) | ||
261 | 207 | ||
262 | ## Initialise Database and Activate Advanced Features | 208 | ## Initialise Database and Activate Advanced Features |
263 | 209 | ||
264 | - sudo -u gitlab -H bundle exec rake gitlab:setup RAILS_ENV=production | 210 | + sudo -u git -H bundle exec rake gitlab:setup RAILS_ENV=production |
265 | 211 | ||
266 | 212 | ||
267 | ## Install Init Script | 213 | ## Install Init Script |
@@ -280,11 +226,11 @@ Make GitLab start on boot: | @@ -280,11 +226,11 @@ Make GitLab start on boot: | ||
280 | 226 | ||
281 | Check if GitLab and its environment is configured correctly: | 227 | Check if GitLab and its environment is configured correctly: |
282 | 228 | ||
283 | - sudo -u gitlab -H bundle exec rake gitlab:env:info RAILS_ENV=production | 229 | + sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production |
284 | 230 | ||
285 | To make sure you didn't miss anything run a more thorough check with: | 231 | To make sure you didn't miss anything run a more thorough check with: |
286 | 232 | ||
287 | - sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production | 233 | + sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production |
288 | 234 | ||
289 | If all items are green, then congratulations on successfully installing GitLab! | 235 | If all items are green, then congratulations on successfully installing GitLab! |
290 | However there are still a few steps left. | 236 | However there are still a few steps left. |
@@ -357,7 +303,7 @@ a different host, you can configure its connection string via the | @@ -357,7 +303,7 @@ a different host, you can configure its connection string via the | ||
357 | 303 | ||
358 | If you are running SSH on a non-standard port, you must change the gitlab user'S SSH config. | 304 | If you are running SSH on a non-standard port, you must change the gitlab user'S SSH config. |
359 | 305 | ||
360 | - # Add to /home/gitlab/.ssh/config | 306 | + # Add to /home/git/.ssh/config |
361 | host localhost # Give your setup a name (here: override localhost) | 307 | host localhost # Give your setup a name (here: override localhost) |
362 | user git # Your remote git user | 308 | user git # Your remote git user |
363 | port 2222 # Your port number | 309 | port 2222 # Your port number |