-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmonster_reborn.sh
113 lines (94 loc) · 5.01 KB
/
monster_reborn.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
VERDE='\033[0;32m'
NC='\033[0m' # No Color
# ------------------------- Bienvenida --------------------------------
echo "${VERDE}[+][+][+][+][+][+][+]${NC} ¿Volviste a destrozar todo tu sistema? No te preocupes, yo instalo todo por ti. ${VERDE}[+][+][+][+][+][+][+]${NC}"
echo -n "¿Cual es tu nombre de tu cuenta de usuario en Github? > "
read nombre
echo -n "¿Cual es el email de tu cuenta de usuario en Github > "
read usuario
# ------------------------- Actualizando sistema -----------------------
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Actualizando sistema... ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo apt-get update
sudo apt-get -y upgrade
# ------------------------- Instalando ambiente de desarrollo para odoo --------------
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Instalando herramientas de desarrollo ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo apt-get -y install python-pip
sudo pip install odoorpc
sudo pip install ipdb
sudo add-apt-repository -y ppa:webupd8team/sublime-text-3
sudo apt-get update
sudo apt-get install -y sublime-text-installer
sudo apt-get install -y terminator
sudo apt-get install -y pylint python-flake8
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Instalando git ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo apt-get -y install git git-core
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Configurando globales ${VERDE}[+][+][+][+][+][+][+]${NC}"
git config --global user.name $nombre
git config --global user.email $email
# ---------------------------- Instalando google chrome
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Instalando google chrome ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo apt-get install -y libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb
sudo apt-get install -f
# -------------------------- Instalando odoo ---------------------------
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Instalando postgresql ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo apt-get install -y postgresql postgresql-contrib
sudo apt-get install -y postgresql-server-dev-9.5
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Creando usuario de postgreSQL ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo su - postgres -c "createuser -s $USER"
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Instalando requerimientos de odoo ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo apt-get install python-dev libxml2-dev libxslt-dev libevent-dev libsasl2-dev libldap2-dev
sudo apt-get install -y npm
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo npm install -g less
# ---------------------------- Instalando Postig para tms
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Instalando postgis para TMS ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo apt-get install -y postgis postgresql-9.5-postgis-2.2
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Creando extenciones en tempalte1 para postgis ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo -u postgres psql -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" template1
# ---------------------------- Clonando enterprise
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Clonando enterprise ${VERDE}[+][+][+][+][+][+][+]${NC}"
mkdir jarsa
cd jarsa
git clone https://github.com/Jarsa-dev/enterprise
cd enterprise
enterprise=" $PWD"","
cd ..
echo $enterprise
# ---------------------------- Clonando geospatial
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Clonando geospatial ${VERDE}[+][+][+][+][+][+][+]${NC}"
git clone -b 9.0 https://github.com/OCA/geospatial
cd geospatial
geospatial=" $PWD"","
cd ..
# ---------------------------- Clonando operating unit
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Clonando operating unit ${VERDE}[+][+][+][+][+][+][+]${NC}"
git clone -b 9.0 http://github.com/Jarsa-dev/operating-unit
cd operating-unit
operating_unit=" $PWD"","
cd ..
# ---------------------------- Clonando, Configurando e Instalando ambiente para TMS
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Clonando TMS desde Jarsa ${VERDE}[+][+][+][+][+][+][+]${NC}"
git clone http://github.com/Jarsa/transport-management-system
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Configurando remotos para TMS ${VERDE}[+][+][+][+][+][+][+]${NC}"
cd transport-management-system
TMS=" $PWD"","
git remote rename origin jarsa
git remote add jarsa-dev http://github.com/Jarsa-dev/transport-management-system
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Instalando requerimientos para TMS ${VERDE}[+][+][+][+][+][+][+]${NC}"
sudo pip install -r requirements.txt
cd ..
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Clonando odoo 9.0 comunity en dentro de la carpeta dev-odoo ${VERDE}[+][+][+][+][+][+][+]${NC}"
git clone -b 9.0 https://github.com/odoo/odoo.git
cd odoo
sudo pip install -r requirements.txt
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Creando archivo .openserver ${VERDE}[+][+][+][+][+][+][+]${NC}"
./odoo.py --save --stop-after-init
echo "${VERDE}[+][+][+][+][+][+][+]${NC} Añadiendo lineas al archivo .openerp_serverrc ${VERDE}[+][+][+][+][+][+][+]${NC}"
cd
sed -i "3i $TMS" .openerp_serverrc
sed -i "3i $operating_unit" .openerp_serverrc
sed -i "3i $geospatial" .openerp_serverrc
sed -i "3i $enterprise" .openerp_serverrc