|
|
@ -3,10 +3,28 @@ |
|
|
|
set -eux # -x for verbose logging to juju debug-log |
|
|
|
|
|
|
|
|
|
|
|
#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 |
|
|
|
## |
|
|
|
## Options (changeable thanks to ``/etc/charm/openerp.conf``) |
|
|
|
## |
|
|
|
|
|
|
|
OPENERP_PASSWORD=${OPENERP_PASSWORD:-openerp_password} |
|
|
|
|
|
|
|
## 0k git remote path |
|
|
|
GIT_0K_BASE=${GIT_0K_BASE:-"git.0k.io:/var/git"} |
|
|
|
|
|
|
|
## 0k git remote options |
|
|
|
GIT_0K_CLONE_OPTIONS=${GIT_0K_CLONE_OPTIONS:-""} |
|
|
|
|
|
|
|
## 0k git-sub setup options |
|
|
|
GIT_0K_SUB_SETUP_OPTIONS=${GIT_0K_SUB_SETUP_OPTIONS:-""} |
|
|
|
|
|
|
|
## 0k git default checkout reference (for 0k-oe root package) |
|
|
|
GIT_0K_CHECKOUT_REF=${GIT_0K_CHECKOUT_REF:-"7.0/0k/dev/master"} |
|
|
|
|
|
|
|
|
|
|
|
## |
|
|
|
## Code |
|
|
|
## |
|
|
|
|
|
|
|
apt-get install sudo libxml2-dev libxslt-dev libpq-dev libyaml-dev \ |
|
|
|
zlib1g-dev libfreetype6-dev \ |
|
|
@ -30,7 +48,7 @@ fi |
|
|
|
#pip install pil |
|
|
|
( |
|
|
|
cd /tmp && |
|
|
|
scp "$GIT_BASE"/archives/PIL-1.1.7.tar.gz . && |
|
|
|
scp "$GIT_0K_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 |
|
|
@ -47,7 +65,7 @@ pip install lxml genshi==0.6 pyparsing==1.5.7 psycopg2 pyyaml reportlab mako \ |
|
|
|
## download link in PyPi is dead, |
|
|
|
## and gna.org was down recently |
|
|
|
( |
|
|
|
scp "$GIT_BASE/archives/PyChart-1.39.tar.gz" /tmp && |
|
|
|
scp "$GIT_0K_BASE/archives/PyChart-1.39.tar.gz" /tmp && |
|
|
|
cd /tmp && tar xvzf PyChart*.tar.gz && |
|
|
|
cd PyChart* && |
|
|
|
python setup.py install |
|
|
@ -61,7 +79,7 @@ pip install lxml genshi==0.6 pyparsing==1.5.7 psycopg2 pyyaml reportlab mako \ |
|
|
|
if ! [ -d "/opt/apps/ooop" ]; then |
|
|
|
( |
|
|
|
cd /opt/apps && |
|
|
|
git clone $GIT_CLONE_OPTIONS "$GIT_BASE/0k/ooop.git" && |
|
|
|
git clone $GIT_0K_CLONE_OPTIONS "$GIT_0K_BASE/0k/ooop.git" && |
|
|
|
cd /opt/apps/ooop && |
|
|
|
git checkout 0k/prod/master && |
|
|
|
|
|
|
@ -77,17 +95,18 @@ fi |
|
|
|
|
|
|
|
( |
|
|
|
cd /opt/apps && |
|
|
|
git clone $GIT_CLONE_OPTIONS "$GIT_BASE"/0k/0k-oe.git && |
|
|
|
git clone $GIT_0K_CLONE_OPTIONS "$GIT_0K_BASE"/0k/0k-oe.git && |
|
|
|
cd /opt/apps/0k-oe && |
|
|
|
git checkout "$GIT_CHECKOUT_REF" && |
|
|
|
git sub setup |
|
|
|
|
|
|
|
git checkout "$GIT_0K_CHECKOUT_REF" && |
|
|
|
git sub setup $GIT_0K_SUB_SETUP_OPTIONS -r |
|
|
|
) |
|
|
|
|
|
|
|
adduser --system --home=/var/lib/openerp --group openerp |
|
|
|
|
|
|
|
## XXXvlab: warning password in charm !! |
|
|
|
cp -i etc/openerp-server.conf /etc/ |
|
|
|
sed -ri "s/%%PASSWORD%%/$OPENERP_PASSWORD/g" /etc/openerp-server.conf |
|
|
|
|
|
|
|
cp -i etc/init.d/openerp-server /etc/init.d/ |
|
|
|
|
|
|
|
chown openerp /etc/openerp-server.conf |
|
|
@ -153,7 +172,7 @@ chown openerp . |
|
|
|
|
|
|
|
( |
|
|
|
cd /opt/apps && |
|
|
|
git clone $GIT_CLONE_OPTIONS "$GIT_BASE/0k/0k-manage.git" && |
|
|
|
git clone $GIT_0K_CLONE_OPTIONS "$GIT_0K_BASE/0k/0k-manage.git" && |
|
|
|
cd /opt/apps/0k-manage && |
|
|
|
git checkout 0k/prod/master && |
|
|
|
|