Browse Source

new: using ``Ok-oe`` file hierarchy and generic ``git.0k.io`` access, but lost shared git clone facility.

postgres
Valentin Lab 12 years ago
parent
commit
1df8be71a9
  1. 7
      precise/openerp/etc/default/openerp-server
  2. 14
      precise/openerp/etc/init.d/openerp-server
  3. 84
      precise/openerp/hooks/install

7
precise/openerp/etc/default/openerp-server

@ -0,0 +1,7 @@
DBFILTER="[
# ('^(?P<dbprefix>[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
]"

14
precise/openerp/etc/init.d/openerp-server

@ -18,6 +18,12 @@ DAEMON=/opt/apps/openobject-server/openerp-server
NAME=openerp-server NAME=openerp-server
DESC=openerp-server DESC=openerp-server
DEFAULT_FILE=/etc/default/openerp-server
DBFILTER="'.*'"
[ -e "$DEFAULT_FILE" ] && . "$DEFAULT_FILE"
USER=openerp USER=openerp
test -x ${DAEMON} || exit 0 test -x ${DAEMON} || exit 0
@ -31,7 +37,9 @@ case "${1}" in
start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \ start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \
--chuid ${USER} --background --make-pidfile \ --chuid ${USER} --background --make-pidfile \
--exec ${PYTHON} -- ${DAEMON} --config=/etc/openerp-server.conf \ --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}." echo "${NAME}."
;; ;;
@ -56,7 +64,9 @@ case "${1}" in
start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \ start-stop-daemon --start --quiet --pidfile /var/run/${NAME}.pid \
--chuid ${USER} --background --make-pidfile \ --chuid ${USER} --background --make-pidfile \
--exec ${PYTHON} -- ${DAEMON} --config=/etc/openerp-server.conf \ --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}." echo "${NAME}."
;; ;;

84
precise/openerp/hooks/install

@ -3,15 +3,10 @@
set -eux # -x for verbose logging to juju debug-log set -eux # -x for verbose logging to juju debug-log
cat <<EOF >> /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 \ apt-get install sudo libxml2-dev libxslt-dev libpq-dev libyaml-dev \
zlib1g-dev libfreetype6-dev \ zlib1g-dev libfreetype6-dev \
@ -33,11 +28,12 @@ fi
## Installing PIL with our archive is safer. ## Installing PIL with our archive is safer.
#pip install pil #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 \ 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 : ## Install pychart... from our repo as :
## download link in PyPi is dead, ## download link in PyPi is dead,
## and gna.org was down recently ## 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 ## we have some bug correction and custom features
if ! [ -d "/opt/apps/ooop" ]; then 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 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 adduser --system --home=/var/lib/openerp --group openerp
@ -125,25 +124,6 @@ chown openerp /var/log/openerp -R
#fi #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 ## Install werkzeug from github last version
## because last PyPi version is 8.4 and we need the 9.0+ ## 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 && cd /var/openerp-filestore &&
chown openerp . chown openerp .
) )
Loading…
Cancel
Save