Commit 32ef4e16c9cf61fa04960c25430ba692bebd71d9
1 parent
a1824048
Exists in
master
and in
1 other branch
Adicionando script de instalacao do GITLAB
Showing
1 changed file
with
82 additions
and
0 deletions
Show diff stats
| ... | ... | @@ -0,0 +1,82 @@ |
| 1 | +#!/bin/bash | |
| 2 | + | |
| 3 | +# Coloque aqui os ips do gitlab e do redmine | |
| 4 | +IP_GITLAB= | |
| 5 | +IP_REDMINE= | |
| 6 | + | |
| 7 | +while [ -e $IP_GITLAB ] | |
| 8 | +do | |
| 9 | + echo "Digite o IP externo do Gitlab: " | |
| 10 | + read IP_GITLAB | |
| 11 | + echo "IP digitado: $IP_GITLAB" | |
| 12 | + echo "Confirma (y/n)?" | |
| 13 | + read CONFIRMA | |
| 14 | + if [ "$CONFIRMA" != "y" ] ; then | |
| 15 | + IP_GITLAB= | |
| 16 | + fi | |
| 17 | +done | |
| 18 | + | |
| 19 | +while [ -e $IP_REDMINE ] | |
| 20 | +do | |
| 21 | + echo "Digite o IP externo do Redmine: " | |
| 22 | + read IP_REDMINE | |
| 23 | + echo "IP digitado: $IP_REDMINE" | |
| 24 | + echo "Confirma (y/n)?" | |
| 25 | + read CONFIRMA | |
| 26 | + if [ "$CONFIRMA" != "y" ] ; then | |
| 27 | + IP_REDMINE= | |
| 28 | + fi | |
| 29 | +done | |
| 30 | + | |
| 31 | +# Atualizar o sistema | |
| 32 | +sudo yum update -y | |
| 33 | + | |
| 34 | +# Instalar dependencias | |
| 35 | +sudo yum install wget vim postfix openssh-server -y | |
| 36 | + | |
| 37 | +# Fazer o download do gitlab | |
| 38 | +sudo wget https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.0.0_omnibus-1.el6.x86_64.rpm | |
| 39 | + | |
| 40 | +# Instale o Gitlab | |
| 41 | +echo "Instalando gitlab, leva alguns minutos" | |
| 42 | +sudo rpm -i gitlab-7.0.0_omnibus-1.el6.x86_64.rpm | |
| 43 | + | |
| 44 | +# Criar o arquivo de configuracao do gitlab | |
| 45 | +echo "Criando arquivo de configuracao do gitlab" | |
| 46 | +sudo mkdir -p /etc/gitlab | |
| 47 | +sudo touch /etc/gitlab/gitlab.rb | |
| 48 | +sudo chmod 600 /etc/gitlab/gitlab.rb | |
| 49 | + | |
| 50 | +# Adicionar configuracoes para o gitlab | |
| 51 | +echo "Editando as configuracoes do gitlab" | |
| 52 | +sudo echo "redis['port'] = 1234" >> /etc/gitlab/gitlab.rb | |
| 53 | +sudo echo "postgresql['port'] = 2345" >> /etc/gitlab/gitlab.rb | |
| 54 | +sudo echo "unicorn['port'] = 3456" >> /etc/gitlab/gitlab.rb | |
| 55 | +sudo echo "gitlab_rails['internal_api_url'] = 'http://localhost:3456'" >> /etc/gitlab/gitlab.rb | |
| 56 | +sudo echo "external_url \"http://$IP_GITLAB\"" >> /etc/gitlab/gitlab.rb | |
| 57 | + | |
| 58 | +# Adicionando integracao com redmine | |
| 59 | +sudo echo "gitlab_rails['issues_tracker_redmine'] = 'redmine'" >> /etc/gitlab/gitlab.rb | |
| 60 | +sudo echo "gitlab_rails['issues_tracker_redmine_title'] = 'Redmine'" >> /etc/gitlab/gitlab.rb | |
| 61 | +sudo echo "gitlab_rails['issues_tracker_redmine_project_url'] = 'http://$IP_REDMINE/projects/:issues_tracker_id'" >> /etc/gitlab/gitlab.rb | |
| 62 | +sudo echo "gitlab_rails['issues_tracker_redmine_issues_url'] = 'http://$IP_REDMINE/issues/:id'" >> /etc/gitlab/gitlab.rb | |
| 63 | +sudo echo "gitlab_rails['issues_tracker_redmine_new_issue_url'] = 'http://$IP_REDMINE/projects/:issues_tracker_id/issues/new'" >> /etc/gitlab/gitlab.rb | |
| 64 | + | |
| 65 | +# Liberando firewall para servisos http e ssh | |
| 66 | +echo "Adicionando regras no firewall para habilitar http e ssh, caso estejam desabilitados" | |
| 67 | +sudo lokkit -s http -s ssh | |
| 68 | + | |
| 69 | +# Liberando porta 22, isso e' essencial para o funcionamento do git | |
| 70 | +# Caso queira restringir o acesso para redes especificas, favor adicionar opcao | |
| 71 | +# -s 192.168.0.0/24 | |
| 72 | +#sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT | |
| 73 | + | |
| 74 | +# Roda a configuracao do gitlab | |
| 75 | +echo "Iniciando gitlab" | |
| 76 | +sudo gitlab-ctl reconfigure | |
| 77 | +sudo gitlab-ctl restart | |
| 78 | + | |
| 79 | +# Mostrando os dados do gitlab | |
| 80 | +echo "Sucesso! Para acessar o gitlab, abra no navegador o ip $IP_GITLAB" | |
| 81 | +echo "Usuario: root" | |
| 82 | +echo "Senha: 5iveL!fe" | |
| 0 | 83 | \ No newline at end of file | ... | ... |