Commit a18240480a7c407cc86d8b5abc0adae3d08c582e

Authored by Aline Gonçalves dos Santos
1 parent dffffeff

Atualizando tutorial de gitlab para RPM

@@ -70,6 +70,5 @@ @@ -70,6 +70,5 @@
70 \newpage 70 \newpage
71 \input installDoc/redmine-sei 71 \input installDoc/redmine-sei
72 \input installDoc/gitlab-sei 72 \input installDoc/gitlab-sei
73 -\input installDoc/gitlab_omnibus_issues_tracker_tutorial  
74 73
75 \end{document} 74 \end{document}
installDoc/gitlab-sei.tex
1 \section{Gitlab}\label{gitlab} 1 \section{Gitlab}\label{gitlab}
2 2
3 -\subsection{Instalar Postgresql} 3 +\subsection{Configurações de Porta}
  4 +É essencial a configuração das seguintes portas para o funcionamento correto do Gitlab: \\
  5 +* Abrir porta 22 para uso do git \\
  6 +* Abrir porta 25 para uso do servidor de email postfix \\
4 7
  8 +\subsection{Instalação Gitlab e Integração com Redmine}
5 9
6 -\fbox{\parbox{\textwidth}{  
7 -\texttt{sudo yum localinstall http://yum.postgresql.org/9.3/\\redhat/rhel-6-x86\_64/pgdg-centos93-9.3-1.noarch.rpm -y}}}  
8 -  
9 -\fbox{\parbox{\textwidth}{  
10 -\texttt{  
11 -sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y  
12 -}}}  
13 -  
14 -\subsubsection{Inicializar database}  
15 -  
16 -  
17 -\fbox{\parbox{\textwidth}{  
18 -\texttt{  
19 -sudo service postgresql-9.3 initdb  
20 -}}}  
21 -  
22 -\subsubsection{Iniciar postgresql com o sistema}  
23 -  
24 -\fbox{\parbox{\textwidth}{  
25 -\texttt{  
26 -sudo chkconfig postgresql-9.3 on  
27 -}}}  
28 -  
29 -\subsubsection{Iniciar postgresql}  
30 -  
31 -\fbox{\parbox{\textwidth}{  
32 -\texttt{  
33 -sudo service postgresql-9.3 start  
34 -}}}  
35 -  
36 -\subsection{Adicionar repositório EPEL}  
37 -  
38 -\fbox{\parbox{\textwidth}{  
39 -\texttt{  
40 -sudo yum -y install wget vim  
41 -}}}  
42 -\fbox{\parbox{\textwidth}{  
43 -\texttt{  
44 -sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 \\https://www.fedoraproject.org/static/0608B895.txt  
45 -}}}  
46 -\fbox{\parbox{\textwidth}{  
47 -\texttt{  
48 -sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6  
49 -}}}  
50 -  
51 -\subsection{Adicionar repositório PUIAS Computational (necessário o download de algumas dependências)}  
52 -  
53 -\fbox{\parbox{\textwidth}{  
54 -\texttt{  
55 -sudo rpm -Uvh \\https://dl.fedoraproject.org/pub/epel/6/x86\_64/epel-release-6-8.noarch.rpm  
56 -}}}  
57 -  
58 -\fbox{\parbox{\textwidth}{  
59 -\texttt{  
60 -sudo wget -O /etc/yum.repos.d/PUIAS\_6\_computational.repo \\https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/install/centos/\\PUIAS\_6\_computational.repo  
61 -}}}  
62 -  
63 -\fbox{\parbox{\textwidth}{  
64 -\texttt{  
65 -sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-puias \\http://springdale.math.ias.edu/data/puias/6/x86\_64/os/RPM-GPG-KEY-puias  
66 -}}}  
67 -  
68 -\fbox{\parbox{\textwidth}{  
69 -\texttt{  
70 -sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias  
71 -}}}  
72 -  
73 -\subsubsection{Ativar repositório PUIAS}  
74 10
75 \fbox{\parbox{\textwidth}{ 11 \fbox{\parbox{\textwidth}{
76 -\texttt{  
77 -sudo yum -y install yum-utils  
78 -}}}  
79 -  
80 -\fbox{\parbox{\textwidth}{  
81 -\texttt{  
82 -sudo yum-config-manager --enable epel --enable PUIAS\_6\_computational  
83 -}}}  
84 -  
85 -\subsection{Atualizar todos os pacotes e intalar alguns pacotes adincionais}  
86 -  
87 -\fbox{\parbox{\textwidth}{  
88 -\texttt{  
89 -sudo yum -y update  
90 -}}}  
91 -  
92 -\fbox{\parbox{\textwidth}{  
93 -\texttt{  
94 -sudo yum -y groupinstall 'Development Tools'  
95 -}}}  
96 -  
97 -\fbox{\parbox{\textwidth}{  
98 -\texttt{  
99 -sudo yum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc sqlite-devel libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui redis sudo wget crontabs logwatch logrotate perl-Time-HiRes  
100 -}}}  
101 -  
102 -\subsection{Adicionar redis para iniciar com o sistema e iniciar o sistema}  
103 -  
104 -\fbox{\parbox{\textwidth}{  
105 -\texttt{  
106 -sudo chkconfig redis on  
107 -}}}  
108 -  
109 -\fbox{\parbox{\textwidth}{  
110 -\texttt{  
111 -sudo service redis start  
112 -}}}  
113 -  
114 -\subsection{Instalar o servidor de email postfix}  
115 -  
116 -\fbox{\parbox{\textwidth}{  
117 -\texttt{  
118 -sudo yum -y install postfix  
119 -}}}  
120 -  
121 -\subsection{Remover qualquer pacote git que tenha instalado}  
122 -  
123 -\fbox{\parbox{\textwidth}{  
124 -\texttt{  
125 -sudo yum -y remove git  
126 -}}}  
127 -  
128 -\subsection{Instalar git 1.9.0 e suas dependências}  
129 -  
130 -\fbox{\parbox{\textwidth}{  
131 -\texttt{  
132 -sudo yum -y install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel  
133 -}}}  
134 -  
135 -\fbox{\parbox{\textwidth}{  
136 -\texttt{  
137 -sudo mkdir /tmp/git \&\& cd /tmp/git}}}  
138 -  
139 -\fbox{\parbox{\textwidth}{  
140 -\texttt{  
141 -sudo wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz}}}  
142 -  
143 -\fbox{\parbox{\textwidth}{  
144 -\texttt{  
145 -sudo tar xzf git-1.9.0.tar.gz}}}  
146 -  
147 -\fbox{\parbox{\textwidth}{  
148 -\texttt{  
149 -cd git-1.9.0/}}}  
150 -  
151 -\fbox{\parbox{\textwidth}{  
152 -\texttt{  
153 -sudo ./configure}}}  
154 -  
155 -\fbox{\parbox{\textwidth}{  
156 -\texttt{  
157 -sudo make}}}  
158 -  
159 -\fbox{\parbox{\textwidth}{  
160 -\texttt{  
161 -sudo make prefix=/usr/local install}}}  
162 -  
163 -\subsection{Remover qualquer ruby instalado, e download do ruby-2.0.0-p451}  
164 -  
165 -\fbox{\parbox{\textwidth}{  
166 -\texttt{  
167 -sudo yum remove ruby -y}}}  
168 -  
169 -\fbox{\parbox{\textwidth}{  
170 -\texttt{  
171 -mkdir /tmp/ruby \&\& cd /tmp/ruby}}}  
172 -  
173 -\fbox{\parbox{\textwidth}{  
174 -\texttt{  
175 -sudo curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz  
176 -}}}  
177 -  
178 -\emph{NOTA:}  
179 -  
180 -\fbox{\parbox{\textwidth}{  
181 -\texttt{  
182 -Se não for possível utilizar o host "ruby-2.0.0-p451", você pode tentar esse comando: \\sudo curl --progress http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.bz2 | tar xj  
183 -}}}  
184 -  
185 -\subsection{Install ruby 2.0.0}  
186 -  
187 -\fbox{\parbox{\textwidth}{  
188 -\texttt{  
189 -cd ruby-2.0.0-p451  
190 -\\./configure --disable-install-rdoc  
191 -\\make  
192 -\\sudo make prefix=/usr/local install  
193 -}}}  
194 -  
195 -\subsection{Instalar a bundler gem}  
196 -  
197 -\fbox{\parbox{\textwidth}{  
198 -\texttt{  
199 -sudo /usr/local/bin/gem install bundler --no-ri --no-rdoc  
200 -}}}  
201 -  
202 -\subsection{Ciar um usuário git que tenha as permissões corretas no Gitlab}  
203 -  
204 -\fbox{\parbox{\textwidth}{  
205 -\texttt{  
206 -sudo adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git  
207 -}}}  
208 -  
209 -\subsection{Clonar o gitlab-shell no repositório}  
210 -  
211 -\fbox{\parbox{\textwidth}{  
212 -\texttt{  
213 -sudo su  
214 -\\cd /home/git  
215 -\\sudo -u git -H /usr/local/bin/git clone https://gitlab.com/gitlab-org/gitlab-shell.git  
216 -\\cd gitlab-shell/  
217 -/usr/local/bin/git reset --hard v1.9.3  
218 -}}}  
219 -  
220 -\subsection{Configurar o nome do host e instalar gitlab-shell}  
221 -  
222 -\fbox{\parbox{\textwidth}{  
223 -\texttt{  
224 -sudo -u git -H cp config.yml.example config.yml  
225 -\\sudo -u git -H vim config.yml  
226 -\\sudo -u git -H /usr/local/bin/ruby ./bin/install  
227 -restorecon -Rv /home/git/.ssh  
228 -}}}  
229 -  
230 -\subsection{Criar database gitlabhq\_production, e se for desenvolver no gitlab criar gitlabhq\_development and gitlabhq\_test}  
231 -  
232 -\fbox{\parbox{\textwidth}{  
233 -\texttt{  
234 -sudo -u postgres psql -d template1  
235 -CREATE USER git;  
236 -CREATE DATABASE gitlabhq\_production OWNER git;  
237 -CREATE DATABASE gitlabhq\_development OWNER git;  
238 -CREATE DATABASE gitlabhq\_test OWNER git;  
239 -}}}  
240 -  
241 -\subsection{Adicionar o usuário git no pg\_hba.conf para conceder permissões}  
242 -  
243 -\fbox{\parbox{\textwidth}{  
244 -\texttt{  
245 -vim /var/lib/pgsql/9.3/data/pg\_hba.conf  
246 -}}}  
247 -  
248 -O fim do arquivo deve se parecer o código abaixo:  
249 -  
250 -\fbox{\parbox{\textwidth}{  
251 -\texttt{  
252 -\# TYPE DATABASE USER ADDRESS METHOD  
253 -\\\# "local" is for Unix domain socket connections only  
254 -\\local all postgres peer  
255 -\\local all git trust  
256 -\\\# IPv4 local connections:  
257 -\\host all postgres 127.0.0.1/32 ident  
258 -\\host all git 127.0.0.1/32 trust  
259 -\\\# IPv6 local connections:  
260 -\\host all postgres ::1/128 ident  
261 -\\host all git ::1/128 trust  
262 -}}}  
263 -  
264 -\fbox{\parbox{\textwidth}{  
265 -\texttt{  
266 -[ESC]:wq!  
267 -}}}  
268 -  
269 -\subsection{Reiniciar postgresql}  
270 -  
271 -\fbox{\parbox{\textwidth}{  
272 -\texttt{  
273 -service postgresql-9.3 restart  
274 -}}}  
275 -  
276 -\subsection{Clonar and configurar o repositório do gitlab}  
277 -  
278 -\fbox{\parbox{\textwidth}{  
279 -\texttt{  
280 -cd /home/git  
281 -}}}  
282 -  
283 -\fbox{\parbox{\textwidth}{  
284 -\texttt{  
285 -\\sudo -u git -H /usr/local/bin/git clone \\https://github.com/colab-community/gitlabhq.git -b 7-0-stable gitlab}}}  
286 -  
287 -\fbox{\parbox{\textwidth}{  
288 -\texttt{  
289 -\\cd /home/git/gitlab}}}  
290 -  
291 -\fbox{\parbox{\textwidth}{  
292 -\texttt{  
293 -\\sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml}}}  
294 -  
295 -\fbox{\parbox{\textwidth}{  
296 -\texttt{  
297 -\\chown -R git {log,tmp}}}}  
298 -  
299 -\fbox{\parbox{\textwidth}{  
300 -\texttt{  
301 -\\chmod -R u+rwX {log,tmp}  
302 -}}}  
303 -  
304 -\fbox{\parbox{\textwidth}{  
305 -\texttt{  
306 -\\sudo -u git -H mkdir /home/git/gitlab-satellites}}}  
307 -  
308 -\fbox{\parbox{\textwidth}{  
309 -\texttt{  
310 -\\chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites}}}  
311 -  
312 -\fbox{\parbox{\textwidth}{  
313 -\texttt{  
314 -\\chmod -R u+rwX tmp/{pids,sockets}  
315 -}}}  
316 -  
317 -\fbox{\parbox{\textwidth}{  
318 -\texttt{  
319 -\\chmod -R u+rwX public/uploads}}}  
320 -  
321 -\fbox{\parbox{\textwidth}{  
322 -\texttt{  
323 -\\sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb}}}  
324 -  
325 -\fbox{\parbox{\textwidth}{  
326 -\texttt{  
327 -\\sudo -u git -H cp config/initializers/rack\_attack.rb.example config/initializers/rack\_attack.rb  
328 -}}}  
329 -  
330 -\subsection{Mudar a porta usada para o gitlab, nesse caso use a porta 8090}  
331 -  
332 -\fbox{\parbox{\textwidth}{  
333 -\texttt{  
334 -sudo vim /home/git/gitlab/config/unicorn.rb  
335 -}}}  
336 -  
337 -Mude:  
338 -  
339 -\fbox{\parbox{\textwidth}{  
340 -\texttt{  
341 -listen "127.0.0.1:8080", :tcp\_nopush => true  
342 -}}}  
343 -  
344 -Para:  
345 -  
346 -\fbox{\parbox{\textwidth}{  
347 -\texttt{  
348 -listen "127.0.0.1:8090", :tcp\_nopush => true  
349 -}}}  
350 -  
351 -\fbox{\parbox{\textwidth}{  
352 -\texttt{  
353 -[ESC]:wq!  
354 -}}}  
355 -  
356 -\subsection{Mudar URL defautl no gitlab-shell/config.yml}  
357 -  
358 -\fbox{\parbox{\textwidth}{  
359 -\texttt{  
360 -sudo vim /home/git/gitlab-shell/config.yml  
361 -}}}  
362 -  
363 -Altere a sequinte linha:  
364 -  
365 -\fbox{\parbox{\textwidth}{  
366 -\texttt{  
367 -gitlab\_url: "http://127.0.0.1:8090/gitlab"  
368 -}}}  
369 -  
370 -Para, usando o seu IP:  
371 -  
372 -\fbox{\parbox{\textwidth}{  
373 -\texttt{  
374 -gitlab\_url: "http://127.0.0.1:8090/"  
375 -}}}  
376 -  
377 -\subsection{Configurar git e database}  
378 -  
379 -\fbox{\parbox{\textwidth}{  
380 -\texttt{  
381 -sudo -u git -H /usr/local/bin/git config --global user.name "GitLab"  
382 -}}}  
383 -  
384 -\fbox{\parbox{\textwidth}{  
385 -\texttt{  
386 -sudo -u git -H /usr/local/bin/git config --global user.email "gitlab@localhost"}}}  
387 -  
388 -\fbox{\parbox{\textwidth}{  
389 -\texttt{  
390 -sudo -u git -H /usr/local/bin/git config --global core.autocrlf input}}}  
391 -  
392 -\fbox{\parbox{\textwidth}{  
393 -\texttt{  
394 -sudo -u git cp config/database.yml.postgresql config/database.yml}}}  
395 -  
396 -\fbox{\parbox{\textwidth}{  
397 -\texttt{  
398 -sudo -u git -H chmod o-rwx config/database.yml  
399 -}}}  
400 -  
401 -\subsection{Configurar o bundle}  
402 -  
403 -\fbox{\parbox{\textwidth}{  
404 -\texttt{  
405 -cd /home/git/gitlab  
406 -}}}  
407 -  
408 -\fbox{\parbox{\textwidth}{  
409 -\texttt{  
410 -sudo -u git -H /usr/local/bin/bundle config build.pg --with-pg-config=/usr/\\pgsql-9.3/bin/pg\_config}}}  
411 -  
412 -\fbox{\parbox{\textwidth}{  
413 -\texttt{  
414 -sudo -u git -H /usr/local/bin/bundle config build.nokogiri --use-system-libraries  
415 -}}}  
416 -  
417 -\subsection{Edite arquivos sudores para deixar que bundle, git e gem executem no modo sudo.}  
418 -  
419 -\emph{NOTA:}  
420 -  
421 -\fbox{\parbox{\textwidth}{  
422 -\texttt{  
423 -The path "/usr/bin:/usr/pgsql-9.3/bin/" will be only in this file if you installed postgresql before, if you didn't just remove it from those lines.  
424 -}}}  
425 -  
426 -\fbox{\parbox{\textwidth}{  
427 -\texttt{  
428 -sudo vim /etc/sudoers  
429 -}}}  
430 -  
431 -Altere a linha  
432 -  
433 -\fbox{\parbox{\textwidth}{  
434 -\texttt{  
435 -Defaults secure\_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/  
436 -}}}  
437 -  
438 -Para  
439 -  
440 -\fbox{\parbox{\textwidth}{  
441 -\texttt{  
442 -Defaults secure\_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/:/usr/\\local/bin/  
443 -}}}  
444 -  
445 -\fbox{\parbox{\textwidth}{  
446 -\texttt{  
447 -[ESC]:wq!  
448 -}}}  
449 -  
450 -\subsection{Pegue os pacotes de instalação necessário para instalação das gems, se for desenvolver para o gitlab, altere o env para RAILS\_ENV=development}  
451 -  
452 -\fbox{\parbox{\textwidth}{  
453 -\texttt{  
454 -sudo -u git -H /usr/local/bin/bundle install --deployment --without development test mysql aws  
455 -}}}  
456 -  
457 -\fbox{\parbox{\textwidth}{  
458 -\texttt{  
459 -sudo -u git -H /usr/local/bin/bundle exec rake gitlab:setup RAILS\_ENV=production  
460 -}}}  
461 -  
462 -Escolha yes para criar as tabelas no banco  
463 -  
464 -\emph{NOTA:}  
465 -  
466 -\fbox{\parbox{\textwidth}{  
467 -\texttt{  
468 -Admin login and password -- login: admin@local.host -- password: 5iveL!fe  
469 -}}}  
470 -  
471 -\subsection{Adicionar gitlab para iniciar com o sistema, esse passo não é requisito para o modo de desenvolvimento}  
472 -  
473 -\fbox{\parbox{\textwidth}{  
474 -\texttt{  
475 -wget -O /etc/init.d/gitlab https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/\\init/sysvinit/centos/gitlab-unicorn  
476 -}}}  
477 -  
478 -\fbox{\parbox{\textwidth}{  
479 -\texttt{  
480 -chmod +x /etc/init.d/gitlab}}}  
481 -  
482 -\fbox{\parbox{\textwidth}{  
483 -\texttt{  
484 -chkconfig --add gitlab  
485 -}}}  
486 -  
487 -\fbox{\parbox{\textwidth}{  
488 -\texttt{  
489 -chkconfig gitlab on  
490 -cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab  
491 -service gitlab start  
492 -}}}  
493 -  
494 -\subsection{Compile os asstes, para desenvolvimento altere o env para RAILS\_ENV=development}  
495 -  
496 -\fbox{\parbox{\textwidth}{  
497 -\texttt{  
498 -sudo -u git -H /usr/local/bin/bundle exec rake assets:precompile RAILS\_ENV=production  
499 -}}}  
500 -  
501 -\subsection{Altere as permissões dos grupos}  
502 -  
503 -\fbox{\parbox{\textwidth}{  
504 -\texttt{  
505 -chmod g+rx /home/git/  
506 -}}}  
507 -  
508 -Altere a linha:  
509 -  
510 -\fbox{\parbox{\textwidth}{  
511 -\texttt{  
512 -env: enabled: true  
513 -}}}  
514 -  
515 -Para:  
516 -  
517 -\fbox{\parbox{\textwidth}{  
518 -\texttt{  
519 -env: enabled: false  
520 -}}}  
521 -  
522 -Altere essas linhas:  
523 -  
524 -\fbox{\parbox{\textwidth}{  
525 -\texttt{issues\_tracker: \# redmine: \# title: ``Redmine'' \#  
526 -\#\# If not nil, link `Issues' on project page will be replaced with  
527 -this \# \#\# Use placeholders: \# \#\# :project\_id - GitLab project  
528 -identifier \# \#\# :issues\_tracker\_id - Project Name or Id in external  
529 -issue tracker \# project\_url:  
530 -``http://redmine.sample/projects/:issues\_tracker\_id'' \# \# \#\# If  
531 -not nil, links from /\#\d/ entities from commit messages will replaced  
532 -with this \# \#\# Use placeholders: \# \#\# :project\_id - GitLab  
533 -project identifier \# \#\# :issues\_tracker\_id - Project Name or Id in  
534 -external issue tracker \# \#\# :id - Issue id (from commit messages) \#  
535 -issues\_url: ``http://redmine.sample/issues/:id'' \# \# \#\# If not nil,  
536 -links to creating new issues will be replaced with this \# \#\# Use  
537 -placeholders: \# \#\# :project\_id - GitLab project identifier \# \#\#  
538 -:issues\_tracker\_id - Project Name or Id in external issue tracker \#  
539 -new\_issue\_url:  
540 -``http://redmine.sample/projects/:issues\_tracker\_id/issues/new'' \# \#  
541 -jira: \# title: ``Atlassian Jira'' \# project\_url:  
542 -\\``http://jira.sample/issues/?jql=project=:issues\_tracker\_id'' \#  
543 -issues\_url: ``http://jira.sample/browse/:id'' \# new\_issue\_url:  
544 -``http://jira.sample/secure/CreateIssue.jspa''  
545 -}}}  
546 -  
547 -Para:  
548 -  
549 -\fbox{\parbox{\textwidth}{  
550 -\texttt{  
551 -issues\_tracker: redmine: title: ``Redmine'' \#\# If not nil, link  
552 -`Issues' on project page will be replaced with this \#\# Use  
553 -placeholders: \#\# :project\_id - GitLab project identifier \#\#  
554 -:issues\_tracker\_id - Project Name or Id in external issue tracker  
555 -project\_url: "http://redmine.sample/projects/:issues\_tracker\_id"  
556 -\#\# If not nil, links from /\# d/ entities from commit messages will replaced with this  
557 -\#\# Use placeholders:  
558 -\#\# :project\_id - GitLab project identifier  
559 -\#\# :issues\_tracker\_id - Project Name or Id in external issue tracker  
560 -\#\# :id - Issue id (from commit messages)  
561 -issues\_url: "http://redmine.sample/issues/:id"  
562 -\#\# If not nil, links to creating new issues will be replaced with this  
563 -\#\# Use placeholders:  
564 -\#\# :project\_id - GitLab project identifier  
565 -\#\# :issues\_tracker\_id - Project Name or Id in external issue tracker  
566 -new\_issue\_url: "http://redmine.sample/projects/:issues\_tracker\_id/issues/new"  
567 -\# jira:  
568 -\# title: "Atlassian Jira"  
569 -\# project\_url: \\"http://jira.sample/issues/?jql=project=:issues\_tracker\_id"  
570 -\# issues\_url: "http://jira.sample/browse/:id"  
571 -\# new\_issue\_url: "http://jira.sample/secure/CreateIssue.jspa"  
572 - }}}  
573 -  
574 -\emph{NOTA:} Altere todos redmine.sample para seu servidor redmine  
575 -  
576 -\subsection{Restart gitlab} 12 +\texttt{sudo chmod +x instalacaoGitlab.sh}}}
577 13
578 \fbox{\parbox{\textwidth}{ 14 \fbox{\parbox{\textwidth}{
579 -\texttt{  
580 -sudo service gitlab restart  
581 -}}} 15 +\texttt{sudo ./instalacaoGitlab.sh}}}
582 16
583 \emph{NOTA:} 17 \emph{NOTA:}
584 18
585 \fbox{\parbox{\textwidth}{ 19 \fbox{\parbox{\textwidth}{
586 -\texttt{  
587 -Você pode acessar o gitlab usando essa url: `http://localhost:8090/gitlab 20 +\texttt{
  21 +Você pode acessar o gitlab usando a url: http://<IP\_GITLAB> \\
  22 +Usuario: root \\
  23 +Senha 5iveL!fe \\
588 }}} 24 }}}
589 \ No newline at end of file 25 \ No newline at end of file
installDoc/gitlab-sei.txt
@@ -2,419 +2,15 @@ @@ -2,419 +2,15 @@
2 Gitlab 2 Gitlab
3 ====== 3 ======
4 4
  5 +Pré requisitos de instalação gitlab:
  6 +* Abrir porta 22 para uso do git
  7 +* Abrir porta 25 para uso do servidor de email postfix
5 8
6 -Install postgresql 9 +Para instalação do gitlab faça o seguinte:
7 10
8 .. code-block:: 11 .. code-block::
9 12
10 - sudo yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm -y  
11 - sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y 13 + sudo chmod +x instalacaoGitlab.sh
  14 + sudo ./instalacaoGitlab.sh
12 15
13 -Initialize database  
14 -  
15 -.. code-block::  
16 -  
17 - sudo service postgresql-9.3 initdb  
18 -  
19 -Start postgresql with the system  
20 -  
21 -.. code-block::  
22 -  
23 - sudo chkconfig postgresql-9.3 on  
24 -  
25 -Start postgresql  
26 -  
27 -.. code-block::  
28 -  
29 - sudo service postgresql-9.3 start  
30 -  
31 -  
32 -Add EPEL repository  
33 -  
34 -.. code-block::  
35 -  
36 - sudo yum -y install wget vim  
37 - sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 https://www.fedoraproject.org/static/0608B895.txt  
38 - sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6  
39 -  
40 -Add PUIAS Computational repository (necessary to download some exclusive dependencies)  
41 -  
42 -.. code-block::  
43 -  
44 - sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm  
45 - sudo wget -O /etc/yum.repos.d/PUIAS_6_computational.repo https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/install/centos/PUIAS_6_computational.repo  
46 - sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-puias http://springdale.math.ias.edu/data/puias/6/x86_64/os/RPM-GPG-KEY-puias  
47 - sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias  
48 -  
49 -Enable PUIAS repository  
50 -  
51 -.. code-block::  
52 -  
53 - sudo yum -y install yum-utils  
54 - sudo yum-config-manager --enable epel --enable PUIAS_6_computational  
55 -  
56 -Update all packages, and install some addtional packages  
57 -  
58 -.. code-block::  
59 -  
60 - sudo yum -y update  
61 - sudo yum -y groupinstall 'Development Tools'  
62 - sudo yum -y install readline readline-devel ncurses-devel gdbm-devel glibc-devel tcl-devel openssl-devel curl-devel expat-devel db4-devel byacc sqlite-devel libyaml libyaml-devel libffi libffi-devel libxml2 libxml2-devel libxslt libxslt-devel libicu libicu-devel system-config-firewall-tui redis sudo wget crontabs logwatch logrotate perl-Time-HiRes  
63 -  
64 -Add redis to start with the system, and start it  
65 -  
66 -.. code-block::  
67 -  
68 - sudo chkconfig redis on  
69 - sudo service redis start  
70 -  
71 -Install the mail server ``postfix``  
72 -  
73 -.. code-block::  
74 -  
75 - sudo yum -y install postfix  
76 -  
77 -Remove any git package that you may had install  
78 -  
79 -.. code-block::  
80 -  
81 - sudo yum -y remove git  
82 -  
83 -Install git 1.9.0 and its dependencies  
84 -  
85 -.. code-block::  
86 -  
87 - sudo yum -y install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel  
88 - sudo mkdir /tmp/git && cd /tmp/git  
89 - sudo wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz  
90 - sudo tar xzf git-1.9.0.tar.gz  
91 - cd git-1.9.0/  
92 - sudo ./configure  
93 - sudo make  
94 - sudo make prefix=/usr/local install  
95 -  
96 -Remove any ruby installed before, and download ``ruby-2.0.0-p451``  
97 -  
98 -.. code-block::  
99 -  
100 - sudo yum remove ruby -y  
101 - mkdir /tmp/ruby && cd /tmp/ruby  
102 - sudo curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz  
103 -  
104 -*NOTE:*  
105 -  
106 - If you can't reach the host from ``ruby-2.0.0-p451``, you also can try this command: sudo curl --progress http://cache.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.bz2 | tar xj  
107 -  
108 -Install ruby 2.0.0  
109 -  
110 -.. code-block::  
111 -  
112 - cd ruby-2.0.0-p451  
113 - ./configure --disable-install-rdoc  
114 - make  
115 - sudo make prefix=/usr/local install  
116 -  
117 -Install the bundler gem  
118 -  
119 -.. code-block::  
120 -  
121 - sudo /usr/local/bin/gem install bundler --no-ri --no-rdoc  
122 -  
123 -Create the user ``git`` to give the rights permissions to Gitlab application  
124 -  
125 -.. code-block::  
126 -  
127 - sudo adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git  
128 -  
129 -Clone the gitlab-shell repository  
130 -  
131 -.. code-block::  
132 -  
133 - sudo su  
134 - cd /home/git  
135 - sudo -u git -H /usr/local/bin/git clone https://gitlab.com/gitlab-org/gitlab-shell.git  
136 - cd gitlab-shell/  
137 - /usr/local/bin/git reset --hard v1.9.3  
138 -  
139 -Configure the host name and install gitlab-shell  
140 -  
141 -.. code-block::  
142 -  
143 - sudo -u git -H cp config.yml.example config.yml  
144 - sudo -u git -H vim config.yml  
145 - sudo -u git -H /usr/local/bin/ruby ./bin/install  
146 - restorecon -Rv /home/git/.ssh  
147 -  
148 -Create database ``gitlabhq_production``, and if you're going to develop to gitlab also create ``gitlabhq_development`` and ``gitlabhq_test``  
149 -  
150 -.. code-block::  
151 -  
152 - sudo -u postgres psql -d template1  
153 - CREATE USER git;  
154 - CREATE DATABASE gitlabhq_production OWNER git;  
155 - CREATE DATABASE gitlabhq_development OWNER git;  
156 - CREATE DATABASE gitlabhq_test OWNER git;  
157 - \q  
158 -  
159 -Add the git user in pg_hba.conf to grant the permissions  
160 -  
161 -.. code-block::  
162 -  
163 - vim /var/lib/pgsql/9.3/data/pg_hba.conf  
164 -  
165 -The end of file should seems like the piece of code below, if you're following this whole tutorial you must already have the ``colab`` and ``postgres`` set up, if you are not set up ``postgres`` and ``git`` users.  
166 -  
167 -.. code-block::  
168 -  
169 - # TYPE DATABASE USER ADDRESS METHOD  
170 - # "local" is for Unix domain socket connections only  
171 - local all postgres peer  
172 - local all git trust  
173 - # IPv4 local connections:  
174 - host all postgres 127.0.0.1/32 ident  
175 - host all git 127.0.0.1/32 trust  
176 - # IPv6 local connections:  
177 - host all postgres ::1/128 ident  
178 - host all git ::1/128 trust  
179 -  
180 -.. code-block::  
181 -  
182 - [ESC]:wq!  
183 -  
184 -Restart postgresql  
185 -  
186 -.. code-block::  
187 -  
188 - service postgresql-9.3 restart  
189 -  
190 -Clone and configure the ``gitlab`` repository  
191 -  
192 -.. code-block::  
193 -  
194 - cd /home/git  
195 - sudo -u git -H /usr/local/bin/git clone https://github.com/colab-community/gitlabhq.git -b 7-0-stable gitlab  
196 - cd /home/git/gitlab  
197 - sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml  
198 - chown -R git {log,tmp}  
199 - chmod -R u+rwX {log,tmp}  
200 - sudo -u git -H mkdir /home/git/gitlab-satellites  
201 - chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites  
202 - chmod -R u+rwX tmp/{pids,sockets}  
203 - chmod -R u+rwX public/uploads  
204 - sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb  
205 - sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb  
206 -  
207 -Change the port you're using for gitlab, in this case we use 8090  
208 -  
209 -.. code-block::  
210 -  
211 - sudo vim /home/git/gitlab/config/unicorn.rb  
212 -  
213 -Change  
214 -  
215 -.. code-block::  
216 -  
217 - listen "127.0.0.1:8080", :tcp_nopush => true  
218 -  
219 -To  
220 -  
221 -.. code-block::  
222 -  
223 - listen "127.0.0.1:8090", :tcp_nopush => true  
224 -  
225 -.. code-block::  
226 -  
227 - [ESC]:wq!  
228 -  
229 -  
230 -Change defautl URL in gitlab-shell/config.yml  
231 -  
232 -.. code-block::  
233 -  
234 - sudo vim /home/git/gitlab-shell/config.yml  
235 -  
236 -Change the following line, From:  
237 -  
238 -.. code-block::  
239 -  
240 - gitlab_url: "http://127.0.0.1:8090/gitlab"  
241 -  
242 -To, using the your IP:  
243 -  
244 -.. code-block::  
245 -  
246 - gitlab_url: "http://127.0.0.1:8090/"  
247 -  
248 -  
249 -Configure git and database  
250 -  
251 -.. code-block::  
252 -  
253 - sudo -u git -H /usr/local/bin/git config --global user.name "GitLab"  
254 - sudo -u git -H /usr/local/bin/git config --global user.email "gitlab@localhost"  
255 - sudo -u git -H /usr/local/bin/git config --global core.autocrlf input  
256 - sudo -u git cp config/database.yml.postgresql config/database.yml  
257 - sudo -u git -H chmod o-rwx config/database.yml  
258 -  
259 -Configure the bundle  
260 -  
261 -.. code-block::  
262 -  
263 - cd /home/git/gitlab  
264 - sudo -u git -H /usr/local/bin/bundle config build.pg --with-pg-config=/usr/pgsql-9.3/bin/pg_config  
265 - sudo -u git -H /usr/local/bin/bundle config build.nokogiri --use-system-libraries  
266 -  
267 -  
268 -  
269 -Edit sudores file to let ``bundle``, ``git`` and ``gem`` execute in sudo mode.  
270 -  
271 -*NOTE:*  
272 -  
273 - The path ``/usr/bin:/usr/pgsql-9.3/bin/`` will be only in this file if you installed postgresql before, if you didn't just remove it from those lines.  
274 -  
275 -.. code-block::  
276 -  
277 - sudo vim /etc/sudoers  
278 -  
279 -Change the line  
280 -  
281 -.. code-block::  
282 -  
283 - Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/  
284 -  
285 -To  
286 -  
287 -.. code-block::  
288 -  
289 - Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/:/usr/local/bin/  
290 -  
291 -.. code-block::  
292 -  
293 - [ESC]:wq!  
294 -  
295 -Give the bundle install to install the required gems, if you are going to devel to gitlab change the env to ``RAILS_ENV=development``  
296 -  
297 -.. code-block::  
298 -  
299 - sudo -u git -H /usr/local/bin/bundle install --deployment --without development test mysql aws  
300 - sudo -u git -H /usr/local/bin/bundle exec rake gitlab:setup RAILS_ENV=production  
301 -  
302 -Type ``yes`` to create the database tables  
303 -  
304 -*NOTE:*  
305 -  
306 - Admin login and password -- login: admin@local.host -- password: 5iveL!fe  
307 -  
308 -Add gitlab to start with system, this step is not require to development mode  
309 -  
310 -.. code-block::  
311 -  
312 - wget -O /etc/init.d/gitlab https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/init/sysvinit/centos/gitlab-unicorn  
313 - chmod +x /etc/init.d/gitlab  
314 - chkconfig --add gitlab  
315 - chkconfig gitlab on  
316 - cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab  
317 - service gitlab start  
318 -  
319 -Compile the asstes, to development change the env to ``RAILS_ENV=development``  
320 -  
321 -.. code-block::  
322 -  
323 - sudo -u git -H /usr/local/bin/bundle exec rake assets:precompile RAILS_ENV=production  
324 -  
325 -Change group permissions  
326 -  
327 - chmod g+rx /home/git/  
328 -  
329 -  
330 -Altering the line  
331 -  
332 -.. code-block::  
333 -  
334 - env:  
335 - enabled: true  
336 -  
337 -to  
338 -  
339 -.. code-block::  
340 -  
341 - env:  
342 - enabled: false  
343 -  
344 -Change these lines :  
345 -  
346 -.. code-block::  
347 - issues_tracker:  
348 - # redmine:  
349 - # title: "Redmine"  
350 - # ## If not nil, link 'Issues' on project page will be replaced with this  
351 - # ## Use placeholders:  
352 - # ## :project_id - GitLab project identifier  
353 - # ## :issues_tracker_id - Project Name or Id in external issue tracker  
354 - # project_url: "http://redmine.sample/projects/:issues_tracker_id"  
355 - #  
356 - # ## If not nil, links from /#\d/ entities from commit messages will replaced with this  
357 - # ## Use placeholders:  
358 - # ## :project_id - GitLab project identifier  
359 - # ## :issues_tracker_id - Project Name or Id in external issue tracker  
360 - # ## :id - Issue id (from commit messages)  
361 - # issues_url: "http://redmine.sample/issues/:id"  
362 - #  
363 - # ## If not nil, links to creating new issues will be replaced with this  
364 - # ## Use placeholders:  
365 - # ## :project_id - GitLab project identifier  
366 - # ## :issues_tracker_id - Project Name or Id in external issue tracker  
367 - # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new"  
368 - #  
369 - # jira:  
370 - # title: "Atlassian Jira"  
371 - # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id"  
372 - # issues_url: "http://jira.sample/browse/:id"  
373 - # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa"  
374 -  
375 -to  
376 -  
377 -.. code-block::  
378 -  
379 -  
380 - issues_tracker:  
381 - redmine:  
382 - title: "Redmine"  
383 - ## If not nil, link 'Issues' on project page will be replaced with this  
384 - ## Use placeholders:  
385 - ## :project_id - GitLab project identifier  
386 - ## :issues_tracker_id - Project Name or Id in external issue tracker  
387 - project_url: "http://redmine.sample/projects/:issues_tracker_id"  
388 -  
389 - ## If not nil, links from /#\d/ entities from commit messages will replaced with this  
390 - ## Use placeholders:  
391 - ## :project_id - GitLab project identifier  
392 - ## :issues_tracker_id - Project Name or Id in external issue tracker  
393 - ## :id - Issue id (from commit messages)  
394 - issues_url: "http://redmine.sample/issues/:id"  
395 -  
396 - ## If not nil, links to creating new issues will be replaced with this  
397 - ## Use placeholders:  
398 - ## :project_id - GitLab project identifier  
399 - ## :issues_tracker_id - Project Name or Id in external issue tracker  
400 - new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new"  
401 -  
402 - # jira:  
403 - # title: "Atlassian Jira"  
404 - # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id"  
405 - # issues_url: "http://jira.sample/browse/:id"  
406 - # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa"  
407 -  
408 -*NOTE:*  
409 - Change all redmine.sample to your redmine server  
410 -  
411 -  
412 -Restart gitlab  
413 -  
414 -.. code-block::  
415 -  
416 - sudo service gitlab restart  
417 -  
418 -*NOTE:*  
419 -  
420 - You can access gitlab in this url: `http://localhost:8090/gitlab, but it won't log-in without the REMOTE_USER provided by colab 16 +O programa irá pedir o IP do Gitlab e Redmine, digite-os conforme a configuração de IP de cada um no formado ’255.255.255.255’ (sem aspas, apenas numeros e pontos)
421 \ No newline at end of file 17 \ No newline at end of file