Commit 475d39be2d4b8e3816e07f9d7e86571274e553cf
Exists in
master
and in
1 other branch
atualizando scripts
Showing
5 changed files
with
55 additions
and
82 deletions
Show diff stats
script/gitlab.sh
| ... | ... | @@ -2,9 +2,9 @@ |
| 2 | 2 | |
| 3 | 3 | # Coloque aqui os ips do gitlab e do redmine |
| 4 | 4 | IP_GITLAB="localhost" |
| 5 | -IP_REDMINE="localhost" | |
| 6 | -IP_LDAP="localhost" | |
| 7 | -PASSWORD_LDAP="12345678" #"cfl5OcVJ" | |
| 5 | +IP_REDMINE=$1 | |
| 6 | +IP_LDAP=$2 | |
| 7 | +PASSWORD_LDAP=$3 | |
| 8 | 8 | |
| 9 | 9 | while [ -e $IP_GITLAB ] |
| 10 | 10 | do |
| ... | ... | @@ -46,30 +46,31 @@ do |
| 46 | 46 | fi |
| 47 | 47 | done |
| 48 | 48 | |
| 49 | - | |
| 50 | - | |
| 51 | - | |
| 52 | - | |
| 53 | 49 | # Atualizar o sistema |
| 54 | 50 | sudo yum update -y |
| 55 | 51 | |
| 56 | -# Instalar dependencias | |
| 52 | +#1. Instalar dependencias | |
| 53 | + | |
| 57 | 54 | sudo yum install wget vim postfix openssh-server -y |
| 58 | 55 | |
| 59 | -# Fazer o download do gitlab | |
| 56 | +#2. Fazer o download do gitlab | |
| 57 | + | |
| 60 | 58 | sudo wget https://downloads-packages.s3.amazonaws.com/centos-6.5/gitlab-7.0.0_omnibus-1.el6.x86_64.rpm |
| 61 | 59 | |
| 62 | -# Instale o Gitlab | |
| 60 | +#3. Instale o Gitlab | |
| 61 | + | |
| 63 | 62 | echo "Instalando gitlab, leva alguns minutos" |
| 64 | 63 | sudo rpm -i gitlab-7.0.0_omnibus-1.el6.x86_64.rpm |
| 65 | 64 | |
| 66 | -# Criar o arquivo de configuracao do gitlab | |
| 65 | +#4. Criar o arquivo de configuracao do gitlab | |
| 66 | + | |
| 67 | 67 | echo "Criando arquivo de configuracao do gitlab" |
| 68 | 68 | sudo mkdir -p /etc/gitlab |
| 69 | 69 | sudo touch /etc/gitlab/gitlab.rb |
| 70 | 70 | sudo chmod 600 /etc/gitlab/gitlab.rb |
| 71 | 71 | |
| 72 | -# Adicionar configuracoes para o gitlab | |
| 72 | +#5. Adicionar configuracoes para o gitlab | |
| 73 | + | |
| 73 | 74 | echo "Editando as configuracoes do gitlab" |
| 74 | 75 | sudo echo "redis['port'] = 1234" >> /etc/gitlab/gitlab.rb |
| 75 | 76 | sudo echo "postgresql['port'] = 2345" >> /etc/gitlab/gitlab.rb |
| ... | ... | @@ -77,14 +78,15 @@ sudo echo "unicorn['port'] = 3456" >> /etc/gitlab/gitlab.rb |
| 77 | 78 | sudo echo "gitlab_rails['internal_api_url'] = 'http://localhost:3456'" >> /etc/gitlab/gitlab.rb |
| 78 | 79 | sudo echo "external_url \"http://$IP_GITLAB\"" >> /etc/gitlab/gitlab.rb |
| 79 | 80 | |
| 80 | -# Adicionar integracao com redmine | |
| 81 | +#6. Adicionar integracao com redmine | |
| 82 | + | |
| 81 | 83 | sudo echo "gitlab_rails['issues_tracker_redmine'] = 'redmine'" >> /etc/gitlab/gitlab.rb |
| 82 | 84 | sudo echo "gitlab_rails['issues_tracker_redmine_title'] = 'Redmine'" >> /etc/gitlab/gitlab.rb |
| 83 | 85 | sudo echo "gitlab_rails['issues_tracker_redmine_project_url'] = 'http://$IP_REDMINE/projects/:issues_tracker_id'" >> /etc/gitlab/gitlab.rb |
| 84 | 86 | sudo echo "gitlab_rails['issues_tracker_redmine_issues_url'] = 'http://$IP_REDMINE/issues/:id'" >> /etc/gitlab/gitlab.rb |
| 85 | 87 | sudo echo "gitlab_rails['issues_tracker_redmine_new_issue_url'] = 'http://$IP_REDMINE/projects/:issues_tracker_id/issues/new'" >> /etc/gitlab/gitlab.rb |
| 86 | 88 | |
| 87 | -# Liberando firewall para servisos http e ssh | |
| 89 | +#7. Liberando firewall para servisos http e ssh | |
| 88 | 90 | echo "Adicionando regras no firewall para habilitar http e ssh, caso estejam desabilitados" |
| 89 | 91 | sudo lokkit -s http -s ssh |
| 90 | 92 | |
| ... | ... | @@ -116,7 +118,9 @@ echo "Iniciando gitlab" |
| 116 | 118 | sudo gitlab-ctl reconfigure |
| 117 | 119 | sudo gitlab-ctl restart |
| 118 | 120 | |
| 119 | -# Mostrando os dados do gitlab | |
| 121 | +#8. Mostrando os dados do gitlab | |
| 122 | + | |
| 120 | 123 | echo "Sucesso! Para acessar o gitlab, abra no navegador o ip $IP_GITLAB" |
| 121 | 124 | echo "Usuario: root" |
| 122 | 125 | echo "Senha: 5iveL!fe" |
| 126 | + | ... | ... |
script/ldap.sh
| ... | ... | @@ -186,7 +186,7 @@ ou: oldusers " > base.ldif |
| 186 | 186 | |
| 187 | 187 | cd /tmp/ldap |
| 188 | 188 | |
| 189 | -echo "alimentando lda" | |
| 189 | +echo "Inicializando ldap" | |
| 190 | 190 | sleep 10 |
| 191 | 191 | echo "ldapadd -x -D \"cn=admin,${DC}\" -w ${PASSWORD} -f base.ldif" |
| 192 | 192 | ldapadd -x -D "cn=admin,${DC}" -w ${PASSWORD} -f base.ldif | ... | ... |
script/ldap_register.sh
| 1 | + | |
| 1 | 2 | #!/bin/bash |
| 2 | 3 | |
| 3 | 4 | ################################################### Configuração ##################################################### |
| ... | ... | @@ -40,4 +41,3 @@ echo "redmine: ${ADDRESS_REDMINE}" > /opt/Ldap-Register/config/references.yml |
| 40 | 41 | echo "gitlab: ${ADDRESS_GITLAB} " >> /opt/Ldap-Register/config/references.yml |
| 41 | 42 | |
| 42 | 43 | sudo unicorn_rails -c /opt/Ldap-Register/config/unicorn.rb -E production -l 0.0.0.0:3000 -D |
| 43 | - | ... | ... |
script/postgresql.sh
| ... | ... | @@ -3,10 +3,8 @@ |
| 3 | 3 | # Pré-requisitos |
| 4 | 4 | |
| 5 | 5 | sudo yum update -y |
| 6 | -# Todas as máquinas devem ter o usuário colab | |
| 7 | -# O usuário colab das maquinas devem estar no arquivo ``sudoers`` | |
| 8 | 6 | |
| 9 | -# Instalação do Postgres 9.3 | |
| 7 | +# Instalação do Postgres 3 | |
| 10 | 8 | |
| 11 | 9 | # Siga todas as instruções a seguir na máquina destinada ao banco de dados Postgres |
| 12 | 10 | # *NOTE:* |
| ... | ... | @@ -39,62 +37,16 @@ sudo sh -c "source /root/.bashrc" |
| 39 | 37 | |
| 40 | 38 | sudo sed -i 's/\/sbin:\/bin:\/usr\/sbin:\/usr\/bin/\/sbin:\/bin:\/usr\/sbin:\/usr\/bin:\/usr\/pgsql-9.3\/bin/' /etc/sudoers |
| 41 | 39 | |
| 42 | -# sudo vim /etc/sudoers | |
| 43 | -# Dentro do arquivo mude a seguinte linha | |
| 44 | -# Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin | |
| 45 | -# para | |
| 46 | -# Defaults secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/pgsql-9.3/bin/ | |
| 47 | -# Salve e feche o arquivo | |
| 48 | -# [ESC]:wq! | |
| 49 | - | |
| 50 | 40 | # 8. Crie todos os usuários e banco de dados necessários para o funcionamento correto do colab. |
| 51 | 41 | |
| 52 | 42 | sudo -u postgres psql -c "CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'redmine' NOINHERIT VALID UNTIL 'infinity';" |
| 53 | 43 | sudo -u postgres psql -c "CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine;" |
| 54 | 44 | |
| 55 | -#sudo -u postgres psql | |
| 56 | -# | |
| 57 | -# CREATE USER colab SUPERUSER INHERIT CREATEDB CREATEROLE; | |
| 58 | -# ALTER USER colab PASSWORD 'colab'; | |
| 59 | -# CREATE USER git; | |
| 60 | -# CREATE ROLE redmine LOGIN ENCRYPTED PASSWORD 'redmine' NOINHERIT VALID UNTIL 'infinity'; | |
| 61 | -# | |
| 62 | -# CREATE DATABASE gitlabhq_production OWNER git; | |
| 63 | -# CREATE DATABASE "colab" WITH OWNER "colab" ENCODING 'UTF8' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0; | |
| 64 | -# CREATE DATABASE "trac_colab" WITH OWNER "colab" ENCODING 'UTF8' LC_COLLATE='en_US.UTF-8' LC_CTYPE='en_US.UTF-8' TEMPLATE=template0; | |
| 65 | -# CREATE DATABASE redmine WITH ENCODING='UTF8' OWNER=redmine; | |
| 66 | -# \q | |
| 67 | - | |
| 68 | 45 | # 9. Altere o pg_hba.conf para conceder as permissões corretas aos usuários |
| 69 | 46 | |
| 70 | -sudo wget https://gitlab.com/softwarepublico/colabdocumentation/raw/master/Arquivos/postgres/pg_hba.conf -O /var/lib/pgsql/9.3/data/pg_hba.conf | |
| 71 | - | |
| 72 | -# sudo vi /var/lib/pgsql/9.3/data/pg_hba.conf | |
| 73 | - | |
| 74 | -# As permissõe devem ser as que estão abaixo, que serão encontradas no final do arquivo, ou seja, as linhas do fim do arquivo devem ser substituidas. | |
| 75 | - | |
| 76 | - # TYPE DATABASE USER ADDRESS METHOD | |
| 77 | - | |
| 78 | - # "local" is for Unix domain socket connections only | |
| 79 | -# local all postgres peer | |
| 80 | -# local redmine redmine md5 | |
| 81 | -# local trac_colab colab md5 | |
| 82 | -# local colab colab md5 | |
| 83 | -# local gitlabhq_production git trust | |
| 84 | - # IPv4 local connections: | |
| 85 | -# host all postgres 127.0.0.1/32 ident | |
| 86 | -# host redmine redmine 127.0.0.1/32 md5 | |
| 87 | -# host trac_colab colab 127.0.0.1/32 md5 | |
| 88 | -# host colab colab 127.0.0.1/32 md5 | |
| 89 | -# host gitlabhq_production git 127.0.0.1/32 trust | |
| 90 | - # IPv6 local connections: | |
| 91 | -# host all postgres ::1/128 ident | |
| 92 | -# host redmine redmine ::1/128 md5 | |
| 93 | -# host trac_colab colab ::1/128 md5 | |
| 94 | -# host colab colab ::1/128 md5 | |
| 95 | -# host gitlabhq_production git ::1/128 trust | |
| 96 | -# [ESC]:wq! | |
| 47 | +sudo wget https://gitlab.com/softwarepublico/labsei/raw/master/arquivos/postgres/pg_hba.conf -O /var/lib/pgsql/9.3/data/pg_hba.conf | |
| 97 | 48 | |
| 98 | 49 | # 10. Reinicie o postgresql |
| 99 | 50 | |
| 100 | 51 | sudo service postgresql-9.3 restart |
| 52 | + | ... | ... |
script/redmine.sh
| ... | ... | @@ -3,19 +3,22 @@ |
| 3 | 3 | # Pré-requisitos |
| 4 | 4 | |
| 5 | 5 | # Atualizacao |
| 6 | -sudo yum update -y | |
| 7 | 6 | |
| 7 | +sudo yum update -y | |
| 8 | 8 | |
| 9 | 9 | ## Instalação do Redmine 2.3 |
| 10 | 10 | |
| 11 | 11 | # Instalando EPEL |
| 12 | + | |
| 12 | 13 | sudo yum install -y wget |
| 13 | 14 | sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm |
| 14 | 15 | |
| 15 | 16 | # 1. Instale os requisitos |
| 17 | + | |
| 16 | 18 | sudo yum -y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel subversion git postgresql-devel gcc gcc-c++.x86_64 make automake autoconf curl-devel openssl-devel zlib-devel httpd-devel apr-devel apr-util-devel sqlite-devel libxslt-devel libxml2-devel.x86_64 php-pear ImageMagick ImageMagick-devel ImageMagick-perl vim |
| 17 | 19 | |
| 18 | 20 | # 2. Compilando o ruby |
| 21 | + | |
| 19 | 22 | mkdir /tmp/ruby && cd /tmp/ruby |
| 20 | 23 | sudo curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz |
| 21 | 24 | cd ruby-2.0.0-p451 |
| ... | ... | @@ -24,24 +27,29 @@ make |
| 24 | 27 | sudo make prefix=/usr/local install |
| 25 | 28 | |
| 26 | 29 | # 3. Instalando bundle |
| 30 | + | |
| 27 | 31 | sudo /usr/local/bin/gem install bundle --no-ri --no-rdoc |
| 28 | 32 | |
| 29 | 33 | # 4. Adicionando /usr/local/bin no path |
| 34 | + | |
| 30 | 35 | sudo sed -i 's/\/sbin:\/bin:\/usr\/sbin:\/usr\/bin/\/sbin:\/bin:\/usr\/sbin:\/usr\/bin:\/usr\/local\/bin/' /etc/sudoers |
| 31 | 36 | |
| 32 | 37 | # 5. Instalando o redmine 2.3-stable |
| 38 | + | |
| 33 | 39 | cd /opt |
| 34 | 40 | sudo svn co http://svn.redmine.org/redmine/branches/2.3-stable redmine |
| 35 | 41 | sudo mkdir -p tmp/pdf public/plugin_assets |
| 36 | 42 | |
| 37 | -## 6. Instalando gems | |
| 43 | +# 6. Instalando gems | |
| 44 | + | |
| 38 | 45 | sudo chown -R $USER:$GROUP redmine |
| 39 | 46 | cd /opt/redmine |
| 40 | 47 | bundle install --without mysql sqlite |
| 41 | 48 | sudo gem install unicorn --no-ri --no-rdoc |
| 42 | 49 | sudo gem install pg -v '0.17.1' --no-ri --no-rdoc |
| 43 | 50 | |
| 44 | -## 7. Configurar database.yml no Redmine# | |
| 51 | +# 7. Configurar database.yml no Redmine# | |
| 52 | + | |
| 45 | 53 | cd config/ |
| 46 | 54 | mv database.yml.example database.yml |
| 47 | 55 | echo "production: |
| ... | ... | @@ -52,42 +60,51 @@ echo "production: |
| 52 | 60 | password: redmine |
| 53 | 61 | encoding: utf8" > database.yml |
| 54 | 62 | |
| 55 | -## 8. Populando Redmine | |
| 63 | +# 8. Populando Redmine | |
| 64 | + | |
| 56 | 65 | rake generate_secret_token |
| 57 | 66 | RAILS_ENV=production rake db:migrate |
| 58 | 67 | echo "pt-BR" | RAILS_ENV=production rake redmine:load_default_data |
| 59 | 68 | |
| 60 | -## 9. Configurando Unicorn | |
| 69 | +# 9. Configurando Unicorn | |
| 70 | + | |
| 61 | 71 | cd /opt/redmine |
| 62 | 72 | mkdir pids |
| 63 | -wget https://gitlab.com/softwarepublico/colabdocumentation/raw/master/Arquivos/redmine/unicorn.rb -O config/unicorn.rb | |
| 73 | +wget https://gitlab.com/softwarepublico/labsei/raw/master/arquivos/redmine/unicorn.rb -O config/unicorn.rb | |
| 74 | + | |
| 75 | +# 10. Configurando routes.rb | |
| 64 | 76 | |
| 65 | -## 10. Configurando routes.rb | |
| 66 | -wget https://gitlab.com/softwarepublico/colabdocumentation/raw/master/Arquivos/redmine/routes.rb -O config/routes.rb | |
| 77 | +wget https://gitlab.com/softwarepublico/labsei/raw/master/arquivos/redmine/routes.rb -O config/routes.rb | |
| 78 | + | |
| 79 | +# 11. Adicionando link simbólico | |
| 67 | 80 | |
| 68 | -## 11. Adicionando link simbólico | |
| 69 | 81 | ln -s /opt/redmine/public /opt/redmine/public/redmine |
| 70 | 82 | |
| 71 | -## 12. Instalando o plugin do backlogs | |
| 83 | +# 12. Instalando o plugin do backlogs | |
| 84 | + | |
| 72 | 85 | cd /opt/redmine/plugins |
| 73 | 86 | git clone https://github.com/backlogs/redmine_backlogs.git |
| 74 | 87 | cd redmine_backlogs |
| 75 | 88 | git checkout v1.0.6 |
| 76 | 89 | |
| 77 | -## 13. Bundle install | |
| 90 | +# 13. Bundle install | |
| 91 | + | |
| 78 | 92 | RAILS_ENV=production |
| 79 | 93 | export RAILS_ENV |
| 80 | 94 | bundle install |
| 81 | 95 | |
| 82 | -## 14. Corrigindo dependências | |
| 96 | +# 14. Corrigindo dependências | |
| 97 | + | |
| 83 | 98 | sudo /usr/local/bin/gem uninstall rack -v '1.5.2' |
| 84 | 99 | |
| 85 | -## 15. Bundle install redmine | |
| 100 | +# 15. Bundle install redmine | |
| 101 | + | |
| 86 | 102 | cd /opt/redmine |
| 87 | 103 | bundle install --without mysql sqlite |
| 88 | 104 | bundle exec rake db:migrate |
| 89 | 105 | bundle exec rake redmine:backlogs:install story_trackers=2 task_tracker=1 |
| 90 | 106 | |
| 107 | +# 16. Executando redmine | |
| 91 | 108 | |
| 92 | -## 16. Executando redmine | |
| 93 | 109 | sudo unicorn_rails -c /opt/redmine/config/unicorn.rb -E production -l 0.0.0.0:9080 -D |
| 110 | + | ... | ... |