Commit d3a7c8a73f279cec871383ea38c2cbb2485cebae
1 parent
098e7ffa
Exists in
master
and in
1 other branch
Adding redmine script
Showing
1 changed file
with
96 additions
and
0 deletions
Show diff stats
... | ... | @@ -0,0 +1,96 @@ |
1 | +#!/bin/bash | |
2 | + | |
3 | +# Pré-requisitos | |
4 | + | |
5 | +# Atualizacao | |
6 | +yum update -y | |
7 | + | |
8 | +## Instalação do Redmine 2.3 | |
9 | + | |
10 | +# Instalando EPEL | |
11 | +yum install -y wget | |
12 | +rpm -Uvh https://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
13 | + | |
14 | +# 1. Instale os requisitos | |
15 | +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 | |
16 | + | |
17 | +# 2. Compilando o ruby | |
18 | +mkdir /tmp/ruby && cd /tmp/ruby | |
19 | +curl --progress ftp://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz | tar xz | |
20 | +cd ruby-2.0.0-p451 | |
21 | +./configure --disable-install-rdoc | |
22 | +make | |
23 | +make prefix=/usr/local install | |
24 | + | |
25 | +# 3. Instalando bundle | |
26 | +sleep 10 | |
27 | +gem install bundle --no-ri --no-rdoc | |
28 | + | |
29 | +# 4. Adicionando /usr/local/bin no path | |
30 | +sed -i 's/\/sbin:\/bin:\/usr\/sbin:\/usr\/bin/\/sbin:\/bin:\/usr\/sbin:\/usr\/bin:\/usr\/local\/bin/' /etc/sudoers | |
31 | + | |
32 | +# 5. Instalando o redmine 2.3-stable | |
33 | +cd /opt | |
34 | +svn co http://svn.redmine.org/redmine/branches/2.3-stable redmine | |
35 | +mkdir -p tmp/pdf public/plugin_assets | |
36 | + | |
37 | +## 6. Instalando gems | |
38 | +cd /opt/redmine | |
39 | +bundle install --without mysql sqlite | |
40 | +gem install unicorn --no-ri --no-rdoc | |
41 | +gem install pg -v '0.17.1' --no-ri --no-rdoc | |
42 | + | |
43 | +## 7. Configurar database.yml no Redmine# | |
44 | +cd config/ | |
45 | +mv database.yml.example database.yml | |
46 | +echo "production: | |
47 | + adapter: postgresql | |
48 | + database: redmine | |
49 | + host: $1 | |
50 | + username: redmine | |
51 | + password: redmine | |
52 | + encoding: utf8" > database.yml | |
53 | + | |
54 | +## 8. Populando Redmine | |
55 | +rake generate_secret_token | |
56 | +RAILS_ENV=production rake db:migrate | |
57 | +echo "pt-BR" | RAILS_ENV=production rake redmine:load_default_data | |
58 | + | |
59 | +## 9. Configurando Unicorn | |
60 | +cd /opt/redmine | |
61 | +mkdir pids | |
62 | +wget https://gitlab.com/softwarepublico/colabdocumentation/raw/master/Arquivos/redmine/unicorn.rb -O config/unicorn.rb | |
63 | + | |
64 | +## 10. Configurando routes.rb | |
65 | +wget https://gitlab.com/softwarepublico/colabdocumentation/raw/master/Arquivos/redmine/routes.rb -O config/routes.rb | |
66 | + | |
67 | +## 11. Adicionando link simbólico | |
68 | +ln -s /opt/redmine/public /opt/redmine/public/redmine | |
69 | + | |
70 | +## 12. Instalando o plugin do backlogs | |
71 | +cd /opt/redmine/plugins | |
72 | +git clone https://github.com/backlogs/redmine_backlogs.git | |
73 | +cd redmine_backlogs | |
74 | +git checkout v1.0.6 | |
75 | + | |
76 | +## 13. Bundle install | |
77 | +RAILS_ENV=production | |
78 | +export RAILS_ENV | |
79 | +bundle install | |
80 | + | |
81 | +## 14. Corrigindo dependências | |
82 | + | |
83 | +gem uninstall rack -v '1.5.2' | |
84 | + | |
85 | +## 15. Bundle install redmine | |
86 | +cd /opt/redmine | |
87 | +bundle install --without mysql sqlite | |
88 | +bundle exec rake db:migrate | |
89 | +bundle exec rake redmine:backlogs:install story_trackers=2 task_tracker=1 | |
90 | + | |
91 | +## 16. Executando redmine | |
92 | +unicorn_rails -c /opt/redmine/config/unicorn.rb -E production -l 0.0.0.0:9080 -D | |
93 | + | |
94 | + | |
95 | + | |
96 | + | ... | ... |