This repository is used as a codebase for odoo v8.0 instances and the related setup tools (odoo-tools.sh). The master branch of this repo is always a deploy-able production ready branch.
This structure is going to change very soon!
The default latest stable branch is called master. The other branches in the github repository are either production branches starting with "int" or "ext" (intdadi, intdadirle, exthof) or development and bugfix branches (setuptools, fix1234, dev_wsd_templates) that will be merged back into the master branch.
The flow of fast-forward-branch-updates is always: master -> intdadi -> intdadirl1 - intdadirl2 Ext branches are normally not included in the update cycle. Therefore and to make FF possible merges or commits are never done directly in any "int" or "ext" branches Where int marks a server we pay (our own server) for and ext marks a server the custommer pays for (custommer server).
odoo-tools.sh backup
can create backups of odoo, etherpad and owncloud. If you are creating backups always include
the configuration files of the programm as a partial backup also and finally move all partial backups in a single zip or tgz archive.
Odoo backup example:
[instancename]-[progname]_[backuptype]-[YYYY]_[MM]_[DD]_[HHmm].[fileending]
e.g.: o8_intdadi_dadi-odoo_db-2015_01_23_0154.zip
All backup parts must be moved into a final backup archive of the format:
[instancename]-[progname]-[YYYY]_[MM]_[DD]_[HHmm].[fileending]
If it is a cyclical backup e.g. weekly or daily the Date Part can be replaced like this:
[instancename]-[progname]-[YYYY]_week_[weeknumber].[fileending]
[instancename]-[progname]-[YYYY]_day_[monday].[fileending]
odoo-tools.sh is a simple setup script that is able to
HINT: db-tools.sh is used by odoo-tools.sh to backup and restore the database and data-dir of an instance.
This setup process will only work on a fresh install of Ubuntu 14.04 LTS. Make sure timezone is correct and the server has internet access!
ssh yourname@yourserver
sudo su
wget -O - https://raw.githubusercontent.com/OpenAT/odoo_v8.0/master/TOOLS/odoo-tools.sh > odoo-tools.sh
chmod 755 odoo-tools.sh
odoo-tools.sh prepare
Reboot the server!
# USAGE: odoo-tools.sh setup {TARGET_BRANCH}
odoo-tools.sh setup intdadi
This will create a new folder in /opt/odoo_v8.0 called intdadi.
HINT: You can run multiple branches on the same server! All the branches will use and increment the same counter-file for the Database-Port therefore no port collisions can happen between Instances of different branches! A maximum of 99 Instances are possible for all installed branches!
5.1) Create a new Github-Repository manually for the custom-addons-folder of the new instance:
5.2) Create the Default DNS-Entries for the new instance:
5.3) Install the new Instance:
# usage: odoo-tools.sh newdb {TARGET_BRANCH} {SUPER_PASSWORD} {DATABASE_NAME} {DOMAIN_NAME} [CUADDONSREPONAME]
odoo-tools.sh newdb intdadi admin dadi www.datadialog.net
5.4) Save the installation summary in keepass!!!
5.5) Add the instance to the monitoring service
5.6) Ask the customer to set the correct DNS entries: www.datadialog.net, aswidget.www.datadialog.net, pad.www.datadialog.net, cloud.www.datadialog.net
To develop with this repo use this workflow:
# 1.) Clone the repo odoo_v8 branch master locally:
git clone -b master --recurse-submodules https://github.com/OpenAT/odoo_v8.0.git ${instance_dir}
# Check if the upstream (remote) is set correctly for the master branch
git branch -vv
git --set-upstream-to=https://github.com/OpenAT/odoo_v8.0.git master # creates remotes and origin
# 2.) Create and checkout a new branch:
git branch dev-ckeditor_advanced
git checkout dev-ckeditor_advanced
# 3.) Push your Branch to Github (so everybody knows what you are working on)
git commit
git push origin dev-ckeditor_advanced
# 4.) Do stuff and commit and push changes until ready:
git add [file or folders] # This tells git what to include in next commit
git commit -m "[ADD] Added README.md"
git push origin dev-ckeditor_advanced
# 5.) When ready with development
# - create pull request on github (at webpage) if wanted to discuss / review changes
# - Update master branch to latest
# - rebase dev-ckeditor_advanced on master
# - rebase dev-ckeditor_advanced submodules on master
# - merge dev-ckeditor_advanced in master with rebase
git fetch
git checkout master # NOW IN BRANCH master
git pull
git checkout dev-ckeditor_advanced # NOW IN BRANCH dev-ckeditor_advanced
git rebase master
git submodule update
git checkout master # NOW IN BRANCH master
git merge dev-ckeditor_advanced
git push origin master
Adding new Submodules to the repo:
# This is an example how to add a submodule:
git submodule add -b master https://github.com/ether/etherpad-lite.git etherpad-lite
# Ubdate all submodules
git submodule update --rebase --remote --recursive
This is for now only a placeholder but will describe the update process of a customer instance.
# Update Master
git checkout master
git pull
git submodule update
# Update Branch (Code Repo for a server in this case)
git checkout intdadi
git rebase master
git submodule update
git push origin intdadi
git checkout master
git pull
git submodule update --remote --rebase --recursive
git commit -am "[UPDATE] all submodules updated"
git push master