forked from Vauxoo/docker-odoo-training
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·75 lines (64 loc) · 2.96 KB
/
install.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
#!/bin/bash
echo """You can install this script using 'root' user (using 'sudo su - root') and running:
apt-get update && apt-get install -y wget
wget https://raw.githubusercontent.com/Vauxoo/docker-odoo-training/master/install.sh -O install.sh
chmod +x install.sh
./install.sh myusros # Change 'myusros' to use your custom OS' user name
"""
export USER=$1
apt-get update
apt-get install -y python-pip python3-pip libxml2-dev libxslt-dev libevent-dev \
libsasl2-dev libldap2-dev python-lxml python3-lxml libjpeg-dev \
libssl-dev python-dev python3-dev \
curl wget unzip locales tree sudo \
tmux vim wkhtmltopdf git
# Create user of the Operating System.
useradd -d /home/${USER} -m -s /bin/bash -p ${USER}pwd ${USER}
# Upgrade python package manager pip
pip install -U pip
pip3 install -U pip
# Configure locales to avoid coding errors
echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
locale-gen en_US.UTF-8
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales
update-locale LANG=en_US.UTF-8
echo -e "export LANG=en_US.UTF-8\nexport LANGUAGE=en_US.UTF-8\nexport LC_ALL=en_US.UTF-8\nexport PYTHONIOENCODING=UTF-8" | tee -a /etc/bash.bashrc
source /etc/bash.bashrc
# Install postgresql (after configure locales to auto-create cluster with encoding UTF-8)
apt-get install -y postgresql
pg_createcluster 9.5 main95 -e=utf8 || true
/etc/init.d/postgresql start
su - postgres -c "createuser -s ${USER}"
# Download odoo
su - ${USER} -c "git clone --single-branch --depth=10 https://github.com/odoo/odoo.git odoo-repo"
# Install odoo dependencies for py2 and py3
LC_ALL=C.UTF-8 LANG=C.UTF-8 python3.5 -m pip install -Ur /home/${USER}/odoo-repo/requirements.txt
wget https://raw.githubusercontent.com/odoo/odoo/10.0/requirements.txt -O /tmp/req10.txt
python2.7 -m pip install -Ur /tmp/req10.txt
rm /tmp/req10.txt
apt-get install -y npm
ln -s /usr/bin/nodejs /usr/bin/node
npm install -g less
(cd /usr/bin && wget -qO- -t 1 --timeout=240 https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.4/wkhtmltox-0.12.4_linux-generic-amd64.tar.xz | tar -xJ --strip-components=2 wkhtmltox/bin/wkhtmltopdf)
# Install python tools
python2.7 -m pip install -U bpython
python3.5 -m pip install -U bpython
# configure vim IDE
git clone --depth=1 --single-branch https://github.com/spf13/spf13-vim.git /tmp/spf13-vim
su - ${USER} -c "/tmp/spf13-vim/bootstrap.sh"
su - ${USER} -c "mkdir -p ~/.vim/spell"
su - ${USER} -c "wget -q http://ftp.vim.org/pub/vim/runtime/spell/es.utf-8.spl -O ~/.vim/spell/es.utf-8.spl"
echo -e """filetype plugin indent on
\" show existing tab with 4 spaces width
set tabstop=4
\" when indenting with '>', use 4 spaces width
set shiftwidth=4
\" On pressing tab, insert 4 spaces
set expandtab
colorscheme heliotrope
\" Disable pymode because show ImporError
let g:pymode=0
set spelllang=en,es
""" >> /home/${USER}/.vimrc
sed -i 's/ set mouse\=a/\"set mouse\=a/g' /home/${USER}/.vimrc
sed -i "s/let g:neocomplete#enable_at_startup = 1/let g:neocomplete#enable_at_startup = 0/g" /home/${USER}/.vimrc