From 1df8be71a94157b368a2cda106b691080007f2e4 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Tue, 23 Apr 2013 11:52:49 +0200 Subject: [PATCH] new: using ``Ok-oe`` file hierarchy and generic ``git.0k.io`` access, but lost shared git clone facility. --- precise/openerp/etc/default/openerp-server | 7 ++ precise/openerp/etc/init.d/openerp-server | 14 +++- precise/openerp/hooks/install | 84 ++++++++-------------- 3 files changed, 50 insertions(+), 55 deletions(-) create mode 100644 precise/openerp/etc/default/openerp-server diff --git a/precise/openerp/etc/default/openerp-server b/precise/openerp/etc/default/openerp-server new file mode 100644 index 0000000..ee5b599 --- /dev/null +++ b/precise/openerp/etc/default/openerp-server @@ -0,0 +1,7 @@ +DBFILTER="[ +# ('^(?P[a-zA-Z0-9]+)\.(simplee\.fr|0k\.io|txs\.fr)$', '^%(dbprefix)s.*$'), +# ('^(tuxservices|172\.16\.[0-9]+\.[0-9]+)(:[0-9]+)?$', '^tuxservices.*\$'), ## All database will be shown +# (None, '^$') ## Default: no database will be shown + (None, '^.*$') ## All database will be shown + ]" + diff --git a/precise/openerp/etc/init.d/openerp-server b/precise/openerp/etc/init.d/openerp-server index 4165167..2336593 100755 --- a/precise/openerp/etc/init.d/openerp-server +++ b/precise/openerp/etc/init.d/openerp-server @@ -18,6 +18,12 @@ DAEMON=/opt/apps/openobject-server/openerp-server NAME=openerp-server DESC=openerp-server +DEFAULT_FILE=/etc/default/openerp-server + +DBFILTER="'.*'" +[ -e "$DEFAULT_FILE" ] && . "$DEFAULT_FILE" + + USER=openerp test -x ${DAEMON} || exit 0 @@ -31,7 +37,9 @@ case "${1}" in start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \ --chuid ${USER} --background --make-pidfile \ --exec ${PYTHON} -- ${DAEMON} --config=/etc/openerp-server.conf \ - --logfile=/var/log/openerp/openerp-server.log + --logfile=/var/log/openerp/openerp-server.log \ + --db-filter="$DBFILTER" + echo "${NAME}." ;; @@ -56,7 +64,9 @@ case "${1}" in start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \ --chuid ${USER} --background --make-pidfile \ --exec ${PYTHON} -- ${DAEMON} --config=/etc/openerp-server.conf \ - --logfile=/var/log/openerp/openerp-server.log + --logfile=/var/log/openerp/openerp-server.log \ + --db-filter="$DBFILTER" + echo "${NAME}." ;; diff --git a/precise/openerp/hooks/install b/precise/openerp/hooks/install index b980c7e..9ecb8f0 100755 --- a/precise/openerp/hooks/install +++ b/precise/openerp/hooks/install @@ -3,15 +3,10 @@ set -eux # -x for verbose logging to juju debug-log -cat <> /etc/fstab -lxc-nfs-datastore:/srv/lxc-datastore/data/git/var/git /var/git nfs4 timeo=14,intr,bootwait,auto 0 0 -EOF - -mkdir -p /var/git -mount /var/git || exit 1 - -[ -d "/var/git/0k" ] || exit 1 - +#PASSWD= +GIT_BASE=${GIT_BASE:-"git.0k.io:/var/git"} +GIT_CLONE_OPTIONS="" +GIT_CHECKOUT_REF="7.0/0k/dev/master" ## can be a branch, a tag or a commit SHA1 apt-get install sudo libxml2-dev libxslt-dev libpq-dev libyaml-dev \ zlib1g-dev libfreetype6-dev \ @@ -33,11 +28,12 @@ fi ## Installing PIL with our archive is safer. #pip install pil -(cd /tmp && -cp /var/git/archives/PIL-1.1.7.tar.gz . && -tar xvzf PIL-1.1.7.tar.gz && -cd PIL-1.1.7 && -python setup.py install +( + cd /tmp && + scp "$GIT_BASE"/archives/PIL-1.1.7.tar.gz . && + tar xvzf PIL-1.1.7.tar.gz && + cd PIL-1.1.7 && + python setup.py install ) pip install lxml pyparsing==1.5.7 psycopg2 pyyaml reportlab mako \ @@ -50,11 +46,12 @@ pip install lxml pyparsing==1.5.7 psycopg2 pyyaml reportlab mako \ ## Install pychart... from our repo as : ## download link in PyPi is dead, ## and gna.org was down recently +( + scp "$GIT_BASE/archives/PyChart-1.39.tar.gz" /tmp && + cd /tmp && tar xvzf PyChart*.tar.gz && + cd PyChart* && + python setup.py install -cp /var/git/archives/PyChart-1.39.tar.gz /tmp -(cd /tmp ; tar xvzf PyChart*.tar.gz -cd PyChart* -python setup.py install ) @@ -62,27 +59,29 @@ python setup.py install ## we have some bug correction and custom features if ! [ -d "/opt/apps/ooop" ]; then -( -cd /opt/apps && -git clone -s /var/git/0k/ooop.git && -cd /opt/apps/ooop && -git checkout 0k/prod/master && - -## beurk -ln -sf /opt/apps/ooop/ooop.py /srv/virtualenv/default/lib/python2.7/ooop.py -) + ( + cd /opt/apps && + git clone $GIT_CLONE_OPTIONS "$GIT_BASE/0k/ooop.git" && + cd /opt/apps/ooop && + git checkout 0k/prod/master && + + ## beurk + ln -sf /opt/apps/ooop/ooop.py /srv/virtualenv/default/lib/python2.7/ooop.py + ) fi ## -## Install openobject-server from 0k GIT version +## Install 0k-oe ## ( -cd /opt/apps -git clone -s /var/git/0k/openobject-server.git -cd /opt/apps/openobject-server -git checkout 6.1/0k/prod/master + cd /opt/apps && + git clone $GIT_CLONE_OPTIONS "$GIT_BASE"/0k/0k-oe.git && + cd /opt/apps/0k-oe && + git checkout "$GIT_CHECKOUT_REF" && + git sub setup + ) adduser --system --home=/var/lib/openerp --group openerp @@ -125,25 +124,6 @@ chown openerp /var/log/openerp -R #fi -## install addons - -( -mkdir -p /opt/apps/openobject-addons/ && -cd /opt/apps/openobject-addons/ && -git clone -s /var/git/0k/openobject-addons legacy && -cd /opt/apps/openobject-addons/legacy && -git checkout 6.1/0k/dev/master -) - -## Install from 0k GIT version -## because we have bug corrections and new features -( -cd /opt/apps && -git clone -s /var/git/0k/openerp-web.git && -cd /opt/apps/openerp-web && -git checkout 6.1/0k/dev/master -) - ## Install werkzeug from github last version ## because last PyPi version is 8.4 and we need the 9.0+ @@ -165,5 +145,3 @@ ln -sf /var/openerp-filestore filestore && cd /var/openerp-filestore && chown openerp . ) - -