- Install docker
- Create OS "runbot" user.
useradd -d /home/runbot -m -s /bin/bash -p runbotpwd runbot && usermod -aG docker runbot
su - runbot
- Clone all repositories
# Run as runbot user:
mkdir -p ~/instance
git clone [email protected]:Vauxoo/runbot-addons.git -b 11.0 ~/instance/dependencies/runbot-addons
git clone [email protected]:Vauxoo/runbot.git -b 11.0-vauxoo ~/instance/dependencies/odoo-extra
git clone [email protected]:odoo/odoo.git -b 11.0 ~/instance/odoo
- Install dependencies apt and pip packages
# Run as root user:
apt-get install -y python-pip python-dev python-lxml \
libsasl2-dev libldap2-dev libssl-dev \
libjpeg-dev \
python-matplotlib \
nodejs npm node-less
ln -sf /usr/sbin/node /usr/bin/node
sed -i '/lxml/d' /home/runbot/instance/odoo/requirements.txt
pip install -r /home/runbot/instance/odoo/requirements.txt
pip install -U travis2docker simplejson
npm install -g less-plugin-clean-css
locale-gen fr_FR \
&& locale-gen en_US.UTF-8 \
&& dpkg-reconfigure locales \
&& update-locale LANG=en_US.UTF-8 \
&& update-locale LC_ALL=en_US.UTF-8 \
&& ln -s /usr/share/i18n/SUPPORTED /var/lib/locales/supported.d/all \
&& locale-gen \
&& echo 'LANG="en_US.UTF-8"' > /etc/default/locale
- Install and configure postgresql
# Run as root user:
apt-get install -y postgresql-9.3 postgresql-contrib-9.3 postgresql-common postgresql-server-dev-9.3
su - postgres -c "psql -c \"CREATE ROLE runbot LOGIN PASSWORD 'runbotpwd' SUPERUSER INHERIT CREATEDB CREATEROLE;\""
# Run as runbot user:
createdb runbot
- Configure odoo and start it
# Run as runbot user:
echo -e "[options]\naddons_path=${HOME}/instance/dependencies/runbot-addons,\n ${HOME}/instance/dependencies/odoo-extra,\n ${HOME}/instance/odoo/addons,\n ${HOME}/instance/odoo/openerp/addons\ndb_name = runbot\ndbfilter = runbot" | tee -a ~/.openerp_serverrc
# ~/instance/odoo/odoo.py -i runbot_travis2docker --test-enable # If you want test it
~/instance/odoo/odoo.py -i runbot_travis2docker --without-demo=all
- Configure nginx, dns and host
- Create follow site configuration
/etc/nginx/sites-enabled/site-runbot.conf
upstream runbot {
server 127.0.0.1:8080 weight=1 max_fails=3 fail_timeout=200m;
}
server {
listen 80;
server_name ~^(.*)\.runbot\.YOUR_DNS_HOST\.com$ runbot.YOUR_DNS_HOST.com;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
send_timeout 200m;
proxy_read_timeout 200m;
proxy_connect_timeout 200m;
proxy_pass http://runbot;
}
}
-
Restart nginx server to load new site configuration
/etc/init.d/nginx restart
-
Set the dns as hostname
echo runbot.YOUR_DNS_HOST.com > /etc/hostname
orapt-get install -y systemd-services && hostnamectl set-hostname runbot.YOUR_DNS_HOST.com
- Configure ssh keys
- Github require
/home/runbot/.ssh/id_rsa
keys to clone private repositories more info here - Add to known hosts git servers
ssh-keyscan github.com >> ${HOME}/.ssh/known_hosts && ssh-keyscan launchpad.net >> ${HOME}/.ssh/known_hosts && ssh-keyscan bitbucket.org >> ${HOME}/.ssh/known_hosts && ssh-keyscan gitlab.com >> ${HOME}/.ssh/known_hosts && ssh-keyscan git.vauxoo.com >> ${HOME}/.ssh/known_hosts
- Download the big image for runbot_travis2docker
- Run
docker pull vauxoo/odoo-80-image-shippable-auto
to save time in runbot execution.
- Configure setting of runbot
- Open in browser http://YOUR_DNS/web and go to menu:settings/runbot and set your values.
NOTE: For new version of docker configure task=infinity
to fix systemctl
error Running in 75818fbb42af rpc error: code = 2 desc = "containerd: container did not start before the specified timeout"
echo """
[Service]
TasksMax=infinity
""" > /etc/systemd/system/docker.service.d/docker.conf