diff --git a/LabSEI.tex b/LabSEI.tex index 66375ca..55eefc7 100644 --- a/LabSEI.tex +++ b/LabSEI.tex @@ -70,6 +70,5 @@ \newpage \input installDoc/redmine-sei \input installDoc/gitlab-sei -\input installDoc/gitlab_omnibus_issues_tracker_tutorial \end{document} diff --git a/installDoc/gitlab-sei.tex b/installDoc/gitlab-sei.tex index 66ed394..8343047 100644 --- a/installDoc/gitlab-sei.tex +++ b/installDoc/gitlab-sei.tex @@ -1,588 +1,24 @@ \section{Gitlab}\label{gitlab} -\subsection{Instalar Postgresql} +\subsection{Configurações de Porta} +É essencial a configuração das seguintes portas para o funcionamento correto do Gitlab: \\ +* Abrir porta 22 para uso do git \\ +* Abrir porta 25 para uso do servidor de email postfix \\ +\subsection{Instalação Gitlab e Integração com Redmine} -\fbox{\parbox{\textwidth}{ -\texttt{sudo yum localinstall http://yum.postgresql.org/9.3/\\redhat/rhel-6-x86\_64/pgdg-centos93-9.3-1.noarch.rpm -y}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y -}}} - -\subsubsection{Inicializar database} - - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo service postgresql-9.3 initdb -}}} - -\subsubsection{Iniciar postgresql com o sistema} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo chkconfig postgresql-9.3 on -}}} - -\subsubsection{Iniciar postgresql} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo service postgresql-9.3 start -}}} - -\subsection{Adicionar repositório EPEL} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum -y install wget vim -}}} -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 \\https://www.fedoraproject.org/static/0608B895.txt -}}} -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 -}}} - -\subsection{Adicionar repositório PUIAS Computational (necessário o download de algumas dependências)} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo rpm -Uvh \\https://dl.fedoraproject.org/pub/epel/6/x86\_64/epel-release-6-8.noarch.rpm -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -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 -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -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 -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias -}}} - -\subsubsection{Ativar repositório PUIAS} \fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum -y install yum-utils -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum-config-manager --enable epel --enable PUIAS\_6\_computational -}}} - -\subsection{Atualizar todos os pacotes e intalar alguns pacotes adincionais} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum -y update -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum -y groupinstall 'Development Tools' -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -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 -}}} - -\subsection{Adicionar redis para iniciar com o sistema e iniciar o sistema} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo chkconfig redis on -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo service redis start -}}} - -\subsection{Instalar o servidor de email postfix} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum -y install postfix -}}} - -\subsection{Remover qualquer pacote git que tenha instalado} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum -y remove git -}}} - -\subsection{Instalar git 1.9.0 e suas dependências} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum -y install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo mkdir /tmp/git \&\& cd /tmp/git}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo tar xzf git-1.9.0.tar.gz}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -cd git-1.9.0/}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo ./configure}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo make}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo make prefix=/usr/local install}}} - -\subsection{Remover qualquer ruby instalado, e download do ruby-2.0.0-p451} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo yum remove ruby -y}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -mkdir /tmp/ruby \&\& cd /tmp/ruby}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz -}}} - -\emph{NOTA:} - -\fbox{\parbox{\textwidth}{ -\texttt{ -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 -}}} - -\subsection{Install ruby 2.0.0} - -\fbox{\parbox{\textwidth}{ -\texttt{ -cd ruby-2.0.0-p451 -\\./configure --disable-install-rdoc -\\make -\\sudo make prefix=/usr/local install -}}} - -\subsection{Instalar a bundler gem} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo /usr/local/bin/gem install bundler --no-ri --no-rdoc -}}} - -\subsection{Ciar um usuário git que tenha as permissões corretas no Gitlab} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git -}}} - -\subsection{Clonar o gitlab-shell no repositório} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo su -\\cd /home/git -\\sudo -u git -H /usr/local/bin/git clone https://gitlab.com/gitlab-org/gitlab-shell.git -\\cd gitlab-shell/ -/usr/local/bin/git reset --hard v1.9.3 -}}} - -\subsection{Configurar o nome do host e instalar gitlab-shell} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H cp config.yml.example config.yml -\\sudo -u git -H vim config.yml -\\sudo -u git -H /usr/local/bin/ruby ./bin/install -restorecon -Rv /home/git/.ssh -}}} - -\subsection{Criar database gitlabhq\_production, e se for desenvolver no gitlab criar gitlabhq\_development and gitlabhq\_test} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u postgres psql -d template1 -CREATE USER git; -CREATE DATABASE gitlabhq\_production OWNER git; -CREATE DATABASE gitlabhq\_development OWNER git; -CREATE DATABASE gitlabhq\_test OWNER git; -}}} - -\subsection{Adicionar o usuário git no pg\_hba.conf para conceder permissões} - -\fbox{\parbox{\textwidth}{ -\texttt{ -vim /var/lib/pgsql/9.3/data/pg\_hba.conf -}}} - -O fim do arquivo deve se parecer o código abaixo: - -\fbox{\parbox{\textwidth}{ -\texttt{ -\# TYPE DATABASE USER ADDRESS METHOD -\\\# "local" is for Unix domain socket connections only -\\local all postgres peer -\\local all git trust -\\\# IPv4 local connections: -\\host all postgres 127.0.0.1/32 ident -\\host all git 127.0.0.1/32 trust -\\\# IPv6 local connections: -\\host all postgres ::1/128 ident -\\host all git ::1/128 trust -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -[ESC]:wq! -}}} - -\subsection{Reiniciar postgresql} - -\fbox{\parbox{\textwidth}{ -\texttt{ -service postgresql-9.3 restart -}}} - -\subsection{Clonar and configurar o repositório do gitlab} - -\fbox{\parbox{\textwidth}{ -\texttt{ -cd /home/git -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\sudo -u git -H /usr/local/bin/git clone \\https://github.com/colab-community/gitlabhq.git -b 7-0-stable gitlab}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\cd /home/git/gitlab}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\chown -R git {log,tmp}}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\chmod -R u+rwX {log,tmp} -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\sudo -u git -H mkdir /home/git/gitlab-satellites}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\chmod -R u+rwX tmp/{pids,sockets} -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\chmod -R u+rwX public/uploads}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -\\sudo -u git -H cp config/initializers/rack\_attack.rb.example config/initializers/rack\_attack.rb -}}} - -\subsection{Mudar a porta usada para o gitlab, nesse caso use a porta 8090} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo vim /home/git/gitlab/config/unicorn.rb -}}} - -Mude: - -\fbox{\parbox{\textwidth}{ -\texttt{ -listen "127.0.0.1:8080", :tcp\_nopush => true -}}} - -Para: - -\fbox{\parbox{\textwidth}{ -\texttt{ -listen "127.0.0.1:8090", :tcp\_nopush => true -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -[ESC]:wq! -}}} - -\subsection{Mudar URL defautl no gitlab-shell/config.yml} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo vim /home/git/gitlab-shell/config.yml -}}} - -Altere a sequinte linha: - -\fbox{\parbox{\textwidth}{ -\texttt{ -gitlab\_url: "http://127.0.0.1:8090/gitlab" -}}} - -Para, usando o seu IP: - -\fbox{\parbox{\textwidth}{ -\texttt{ -gitlab\_url: "http://127.0.0.1:8090/" -}}} - -\subsection{Configurar git e database} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H /usr/local/bin/git config --global user.name "GitLab" -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H /usr/local/bin/git config --global user.email "gitlab@localhost"}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H /usr/local/bin/git config --global core.autocrlf input}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git cp config/database.yml.postgresql config/database.yml}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H chmod o-rwx config/database.yml -}}} - -\subsection{Configurar o bundle} - -\fbox{\parbox{\textwidth}{ -\texttt{ -cd /home/git/gitlab -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H /usr/local/bin/bundle config build.pg --with-pg-config=/usr/\\pgsql-9.3/bin/pg\_config}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H /usr/local/bin/bundle config build.nokogiri --use-system-libraries -}}} - -\subsection{Edite arquivos sudores para deixar que bundle, git e gem executem no modo sudo.} - -\emph{NOTA:} - -\fbox{\parbox{\textwidth}{ -\texttt{ -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. -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo vim /etc/sudoers -}}} - -Altere a linha - -\fbox{\parbox{\textwidth}{ -\texttt{ -Defaults secure\_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/ -}}} - -Para - -\fbox{\parbox{\textwidth}{ -\texttt{ -Defaults secure\_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/:/usr/\\local/bin/ -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -[ESC]:wq! -}}} - -\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} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H /usr/local/bin/bundle install --deployment --without development test mysql aws -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H /usr/local/bin/bundle exec rake gitlab:setup RAILS\_ENV=production -}}} - -Escolha yes para criar as tabelas no banco - -\emph{NOTA:} - -\fbox{\parbox{\textwidth}{ -\texttt{ -Admin login and password -- login: admin@local.host -- password: 5iveL!fe -}}} - -\subsection{Adicionar gitlab para iniciar com o sistema, esse passo não é requisito para o modo de desenvolvimento} - -\fbox{\parbox{\textwidth}{ -\texttt{ -wget -O /etc/init.d/gitlab https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/\\init/sysvinit/centos/gitlab-unicorn -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -chmod +x /etc/init.d/gitlab}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -chkconfig --add gitlab -}}} - -\fbox{\parbox{\textwidth}{ -\texttt{ -chkconfig gitlab on -cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab -service gitlab start -}}} - -\subsection{Compile os asstes, para desenvolvimento altere o env para RAILS\_ENV=development} - -\fbox{\parbox{\textwidth}{ -\texttt{ -sudo -u git -H /usr/local/bin/bundle exec rake assets:precompile RAILS\_ENV=production -}}} - -\subsection{Altere as permissões dos grupos} - -\fbox{\parbox{\textwidth}{ -\texttt{ -chmod g+rx /home/git/ -}}} - -Altere a linha: - -\fbox{\parbox{\textwidth}{ -\texttt{ -env: enabled: true -}}} - -Para: - -\fbox{\parbox{\textwidth}{ -\texttt{ -env: enabled: false -}}} - -Altere essas linhas: - -\fbox{\parbox{\textwidth}{ -\texttt{issues\_tracker: \# redmine: \# title: ``Redmine'' \# -\#\# If not nil, link `Issues' on project page will be replaced with -this \# \#\# Use placeholders: \# \#\# :project\_id - GitLab project -identifier \# \#\# :issues\_tracker\_id - Project Name or Id in external -issue tracker \# project\_url: -``http://redmine.sample/projects/:issues\_tracker\_id'' \# \# \#\# If -not nil, links from /\#\d/ entities from commit messages will replaced -with this \# \#\# Use placeholders: \# \#\# :project\_id - GitLab -project identifier \# \#\# :issues\_tracker\_id - Project Name or Id in -external issue tracker \# \#\# :id - Issue id (from commit messages) \# -issues\_url: ``http://redmine.sample/issues/:id'' \# \# \#\# If not nil, -links to creating new issues will be replaced with this \# \#\# Use -placeholders: \# \#\# :project\_id - GitLab project identifier \# \#\# -:issues\_tracker\_id - Project Name or Id in external issue tracker \# -new\_issue\_url: -``http://redmine.sample/projects/:issues\_tracker\_id/issues/new'' \# \# -jira: \# title: ``Atlassian Jira'' \# project\_url: -\\``http://jira.sample/issues/?jql=project=:issues\_tracker\_id'' \# -issues\_url: ``http://jira.sample/browse/:id'' \# new\_issue\_url: -``http://jira.sample/secure/CreateIssue.jspa'' -}}} - -Para: - -\fbox{\parbox{\textwidth}{ -\texttt{ -issues\_tracker: redmine: title: ``Redmine'' \#\# If not nil, link -`Issues' on project page will be replaced with this \#\# Use -placeholders: \#\# :project\_id - GitLab project identifier \#\# -:issues\_tracker\_id - Project Name or Id in external issue tracker -project\_url: "http://redmine.sample/projects/:issues\_tracker\_id" -\#\# If not nil, links from /\# d/ entities from commit messages will replaced with this -\#\# Use placeholders: -\#\# :project\_id - GitLab project identifier -\#\# :issues\_tracker\_id - Project Name or Id in external issue tracker -\#\# :id - Issue id (from commit messages) -issues\_url: "http://redmine.sample/issues/:id" -\#\# If not nil, links to creating new issues will be replaced with this -\#\# Use placeholders: -\#\# :project\_id - GitLab project identifier -\#\# :issues\_tracker\_id - Project Name or Id in external issue tracker -new\_issue\_url: "http://redmine.sample/projects/:issues\_tracker\_id/issues/new" -\# jira: -\# title: "Atlassian Jira" -\# project\_url: \\"http://jira.sample/issues/?jql=project=:issues\_tracker\_id" -\# issues\_url: "http://jira.sample/browse/:id" -\# new\_issue\_url: "http://jira.sample/secure/CreateIssue.jspa" - }}} - -\emph{NOTA:} Altere todos redmine.sample para seu servidor redmine - -\subsection{Restart gitlab} +\texttt{sudo chmod +x instalacaoGitlab.sh}}} \fbox{\parbox{\textwidth}{ -\texttt{ -sudo service gitlab restart -}}} +\texttt{sudo ./instalacaoGitlab.sh}}} \emph{NOTA:} \fbox{\parbox{\textwidth}{ -\texttt{ -Você pode acessar o gitlab usando essa url: `http://localhost:8090/gitlab +\texttt{ +Você pode acessar o gitlab usando a url: http:// \\ +Usuario: root \\ +Senha 5iveL!fe \\ }}} \ No newline at end of file diff --git a/installDoc/gitlab-sei.txt b/installDoc/gitlab-sei.txt index 4fb2369..c5b570f 100644 --- a/installDoc/gitlab-sei.txt +++ b/installDoc/gitlab-sei.txt @@ -2,419 +2,15 @@ Gitlab ====== +Pré requisitos de instalação gitlab: +* Abrir porta 22 para uso do git +* Abrir porta 25 para uso do servidor de email postfix -Install postgresql +Para instalação do gitlab faça o seguinte: .. code-block:: - sudo yum localinstall http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-centos93-9.3-1.noarch.rpm -y - sudo yum install postgresql93 postgresql93-devel postgresql93-libs postgresql93-server -y + sudo chmod +x instalacaoGitlab.sh + sudo ./instalacaoGitlab.sh -Initialize database - -.. code-block:: - - sudo service postgresql-9.3 initdb - -Start postgresql with the system - -.. code-block:: - - sudo chkconfig postgresql-9.3 on - -Start postgresql - -.. code-block:: - - sudo service postgresql-9.3 start - - -Add EPEL repository - -.. code-block:: - - sudo yum -y install wget vim - sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 https://www.fedoraproject.org/static/0608B895.txt - sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 - -Add PUIAS Computational repository (necessary to download some exclusive dependencies) - -.. code-block:: - - sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm - 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 - 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 - sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-puias - -Enable PUIAS repository - -.. code-block:: - - sudo yum -y install yum-utils - sudo yum-config-manager --enable epel --enable PUIAS_6_computational - -Update all packages, and install some addtional packages - -.. code-block:: - - sudo yum -y update - sudo yum -y groupinstall 'Development Tools' - 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 - -Add redis to start with the system, and start it - -.. code-block:: - - sudo chkconfig redis on - sudo service redis start - -Install the mail server ``postfix`` - -.. code-block:: - - sudo yum -y install postfix - -Remove any git package that you may had install - -.. code-block:: - - sudo yum -y remove git - -Install git 1.9.0 and its dependencies - -.. code-block:: - - sudo yum -y install zlib-devel perl-CPAN gettext curl-devel expat-devel gettext-devel openssl-devel - sudo mkdir /tmp/git && cd /tmp/git - sudo wget https://git-core.googlecode.com/files/git-1.9.0.tar.gz - sudo tar xzf git-1.9.0.tar.gz - cd git-1.9.0/ - sudo ./configure - sudo make - sudo make prefix=/usr/local install - -Remove any ruby installed before, and download ``ruby-2.0.0-p451`` - -.. code-block:: - - sudo yum remove ruby -y - mkdir /tmp/ruby && cd /tmp/ruby - sudo curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz - -*NOTE:* - - 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 - -Install ruby 2.0.0 - -.. code-block:: - - cd ruby-2.0.0-p451 - ./configure --disable-install-rdoc - make - sudo make prefix=/usr/local install - -Install the bundler gem - -.. code-block:: - - sudo /usr/local/bin/gem install bundler --no-ri --no-rdoc - -Create the user ``git`` to give the rights permissions to Gitlab application - -.. code-block:: - - sudo adduser --system --shell /bin/bash --comment 'GitLab' --create-home --home-dir /home/git/ git - -Clone the gitlab-shell repository - -.. code-block:: - - sudo su - cd /home/git - sudo -u git -H /usr/local/bin/git clone https://gitlab.com/gitlab-org/gitlab-shell.git - cd gitlab-shell/ - /usr/local/bin/git reset --hard v1.9.3 - -Configure the host name and install gitlab-shell - -.. code-block:: - - sudo -u git -H cp config.yml.example config.yml - sudo -u git -H vim config.yml - sudo -u git -H /usr/local/bin/ruby ./bin/install - restorecon -Rv /home/git/.ssh - -Create database ``gitlabhq_production``, and if you're going to develop to gitlab also create ``gitlabhq_development`` and ``gitlabhq_test`` - -.. code-block:: - - sudo -u postgres psql -d template1 - CREATE USER git; - CREATE DATABASE gitlabhq_production OWNER git; - CREATE DATABASE gitlabhq_development OWNER git; - CREATE DATABASE gitlabhq_test OWNER git; - \q - -Add the git user in pg_hba.conf to grant the permissions - -.. code-block:: - - vim /var/lib/pgsql/9.3/data/pg_hba.conf - -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. - -.. code-block:: - - # TYPE DATABASE USER ADDRESS METHOD - # "local" is for Unix domain socket connections only - local all postgres peer - local all git trust - # IPv4 local connections: - host all postgres 127.0.0.1/32 ident - host all git 127.0.0.1/32 trust - # IPv6 local connections: - host all postgres ::1/128 ident - host all git ::1/128 trust - -.. code-block:: - - [ESC]:wq! - -Restart postgresql - -.. code-block:: - - service postgresql-9.3 restart - -Clone and configure the ``gitlab`` repository - -.. code-block:: - - cd /home/git - sudo -u git -H /usr/local/bin/git clone https://github.com/colab-community/gitlabhq.git -b 7-0-stable gitlab - cd /home/git/gitlab - sudo -u git -H cp config/gitlab.yml.example config/gitlab.yml - chown -R git {log,tmp} - chmod -R u+rwX {log,tmp} - sudo -u git -H mkdir /home/git/gitlab-satellites - chmod u+rwx,g+rx,o-rwx /home/git/gitlab-satellites - chmod -R u+rwX tmp/{pids,sockets} - chmod -R u+rwX public/uploads - sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb - sudo -u git -H cp config/initializers/rack_attack.rb.example config/initializers/rack_attack.rb - -Change the port you're using for gitlab, in this case we use 8090 - -.. code-block:: - - sudo vim /home/git/gitlab/config/unicorn.rb - -Change - -.. code-block:: - - listen "127.0.0.1:8080", :tcp_nopush => true - -To - -.. code-block:: - - listen "127.0.0.1:8090", :tcp_nopush => true - -.. code-block:: - - [ESC]:wq! - - -Change defautl URL in gitlab-shell/config.yml - -.. code-block:: - - sudo vim /home/git/gitlab-shell/config.yml - -Change the following line, From: - -.. code-block:: - - gitlab_url: "http://127.0.0.1:8090/gitlab" - -To, using the your IP: - -.. code-block:: - - gitlab_url: "http://127.0.0.1:8090/" - - -Configure git and database - -.. code-block:: - - sudo -u git -H /usr/local/bin/git config --global user.name "GitLab" - sudo -u git -H /usr/local/bin/git config --global user.email "gitlab@localhost" - sudo -u git -H /usr/local/bin/git config --global core.autocrlf input - sudo -u git cp config/database.yml.postgresql config/database.yml - sudo -u git -H chmod o-rwx config/database.yml - -Configure the bundle - -.. code-block:: - - cd /home/git/gitlab - sudo -u git -H /usr/local/bin/bundle config build.pg --with-pg-config=/usr/pgsql-9.3/bin/pg_config - sudo -u git -H /usr/local/bin/bundle config build.nokogiri --use-system-libraries - - - -Edit sudores file to let ``bundle``, ``git`` and ``gem`` execute in sudo mode. - -*NOTE:* - - 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. - -.. code-block:: - - sudo vim /etc/sudoers - -Change the line - -.. code-block:: - - Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/ - -To - -.. code-block:: - - Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/:/usr/local/bin/ - -.. code-block:: - - [ESC]:wq! - -Give the bundle install to install the required gems, if you are going to devel to gitlab change the env to ``RAILS_ENV=development`` - -.. code-block:: - - sudo -u git -H /usr/local/bin/bundle install --deployment --without development test mysql aws - sudo -u git -H /usr/local/bin/bundle exec rake gitlab:setup RAILS_ENV=production - -Type ``yes`` to create the database tables - -*NOTE:* - - Admin login and password -- login: admin@local.host -- password: 5iveL!fe - -Add gitlab to start with system, this step is not require to development mode - -.. code-block:: - - wget -O /etc/init.d/gitlab https://gitlab.com/gitlab-org/gitlab-recipes/raw/master/init/sysvinit/centos/gitlab-unicorn - chmod +x /etc/init.d/gitlab - chkconfig --add gitlab - chkconfig gitlab on - cp lib/support/logrotate/gitlab /etc/logrotate.d/gitlab - service gitlab start - -Compile the asstes, to development change the env to ``RAILS_ENV=development`` - -.. code-block:: - - sudo -u git -H /usr/local/bin/bundle exec rake assets:precompile RAILS_ENV=production - -Change group permissions - - chmod g+rx /home/git/ - - -Altering the line - -.. code-block:: - - env: - enabled: true - -to - -.. code-block:: - - env: - enabled: false - -Change these lines : - -.. code-block:: - issues_tracker: - # redmine: - # title: "Redmine" - # ## If not nil, link 'Issues' on project page will be replaced with this - # ## Use placeholders: - # ## :project_id - GitLab project identifier - # ## :issues_tracker_id - Project Name or Id in external issue tracker - # project_url: "http://redmine.sample/projects/:issues_tracker_id" - # - # ## If not nil, links from /#\d/ entities from commit messages will replaced with this - # ## Use placeholders: - # ## :project_id - GitLab project identifier - # ## :issues_tracker_id - Project Name or Id in external issue tracker - # ## :id - Issue id (from commit messages) - # issues_url: "http://redmine.sample/issues/:id" - # - # ## If not nil, links to creating new issues will be replaced with this - # ## Use placeholders: - # ## :project_id - GitLab project identifier - # ## :issues_tracker_id - Project Name or Id in external issue tracker - # new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new" - # - # jira: - # title: "Atlassian Jira" - # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id" - # issues_url: "http://jira.sample/browse/:id" - # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa" - -to - -.. code-block:: - - - issues_tracker: - redmine: - title: "Redmine" - ## If not nil, link 'Issues' on project page will be replaced with this - ## Use placeholders: - ## :project_id - GitLab project identifier - ## :issues_tracker_id - Project Name or Id in external issue tracker - project_url: "http://redmine.sample/projects/:issues_tracker_id" - - ## If not nil, links from /#\d/ entities from commit messages will replaced with this - ## Use placeholders: - ## :project_id - GitLab project identifier - ## :issues_tracker_id - Project Name or Id in external issue tracker - ## :id - Issue id (from commit messages) - issues_url: "http://redmine.sample/issues/:id" - - ## If not nil, links to creating new issues will be replaced with this - ## Use placeholders: - ## :project_id - GitLab project identifier - ## :issues_tracker_id - Project Name or Id in external issue tracker - new_issue_url: "http://redmine.sample/projects/:issues_tracker_id/issues/new" - - # jira: - # title: "Atlassian Jira" - # project_url: "http://jira.sample/issues/?jql=project=:issues_tracker_id" - # issues_url: "http://jira.sample/browse/:id" - # new_issue_url: "http://jira.sample/secure/CreateIssue.jspa" - -*NOTE:* - Change all redmine.sample to your redmine server - - -Restart gitlab - -.. code-block:: - - sudo service gitlab restart - -*NOTE:* - - You can access gitlab in this url: `http://localhost:8090/gitlab, but it won't log-in without the REMOTE_USER provided by colab +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) \ No newline at end of file -- libgit2 0.21.2