From 3cc64673bbdb601f3509af705f4e0b1320729d90 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 21 Aug 2013 15:43:31 +0200 Subject: [PATCH] chg: renamed ``openerp`` charm to ``0k-openerp``. --- .../etc/default/openerp-server | 0 .../etc/init.d/openerp-server | 0 .../etc/openerp-server.conf | 2 +- precise/{openerp => 0k-openerp}/hooks/install | 43 +++++++++++++------ precise/{openerp => 0k-openerp}/hooks/start | 0 precise/{openerp => 0k-openerp}/hooks/stop | 0 precise/{openerp => 0k-openerp}/metadata.yaml | 2 +- precise/{openerp => 0k-openerp}/revision | 0 precise/minecraft/hooks/install | 4 +- 9 files changed, 35 insertions(+), 16 deletions(-) rename precise/{openerp => 0k-openerp}/etc/default/openerp-server (100%) rename precise/{openerp => 0k-openerp}/etc/init.d/openerp-server (100%) rename precise/{openerp => 0k-openerp}/etc/openerp-server.conf (98%) rename precise/{openerp => 0k-openerp}/hooks/install (79%) rename precise/{openerp => 0k-openerp}/hooks/start (100%) rename precise/{openerp => 0k-openerp}/hooks/stop (100%) rename precise/{openerp => 0k-openerp}/metadata.yaml (91%) rename precise/{openerp => 0k-openerp}/revision (100%) diff --git a/precise/openerp/etc/default/openerp-server b/precise/0k-openerp/etc/default/openerp-server similarity index 100% rename from precise/openerp/etc/default/openerp-server rename to precise/0k-openerp/etc/default/openerp-server diff --git a/precise/openerp/etc/init.d/openerp-server b/precise/0k-openerp/etc/init.d/openerp-server similarity index 100% rename from precise/openerp/etc/init.d/openerp-server rename to precise/0k-openerp/etc/init.d/openerp-server diff --git a/precise/openerp/etc/openerp-server.conf b/precise/0k-openerp/etc/openerp-server.conf similarity index 98% rename from precise/openerp/etc/openerp-server.conf rename to precise/0k-openerp/etc/openerp-server.conf index c0ad825..e724c02 100644 --- a/precise/openerp/etc/openerp-server.conf +++ b/precise/0k-openerp/etc/openerp-server.conf @@ -3,7 +3,7 @@ ; This is the password that allows database operations ; Will be written to by the server when password is changed ; !! Keep this file secure !! -admin_passwd = atptsfOPratcads +admin_passwd = %%PASSWORD%% root_path = /opt/apps/0k-oe/openobject-server/bin diff --git a/precise/openerp/hooks/install b/precise/0k-openerp/hooks/install similarity index 79% rename from precise/openerp/hooks/install rename to precise/0k-openerp/hooks/install index 637bcee..3ed1acb 100755 --- a/precise/openerp/hooks/install +++ b/precise/0k-openerp/hooks/install @@ -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 && diff --git a/precise/openerp/hooks/start b/precise/0k-openerp/hooks/start similarity index 100% rename from precise/openerp/hooks/start rename to precise/0k-openerp/hooks/start diff --git a/precise/openerp/hooks/stop b/precise/0k-openerp/hooks/stop similarity index 100% rename from precise/openerp/hooks/stop rename to precise/0k-openerp/hooks/stop diff --git a/precise/openerp/metadata.yaml b/precise/0k-openerp/metadata.yaml similarity index 91% rename from precise/openerp/metadata.yaml rename to precise/0k-openerp/metadata.yaml index ae399b7..c5af248 100644 --- a/precise/openerp/metadata.yaml +++ b/precise/0k-openerp/metadata.yaml @@ -1,4 +1,4 @@ -name: openerp +name: 0k-openerp summary: "OpenERP server" maintainer: "Valentin Lab " inherit: python-venv diff --git a/precise/openerp/revision b/precise/0k-openerp/revision similarity index 100% rename from precise/openerp/revision rename to precise/0k-openerp/revision diff --git a/precise/minecraft/hooks/install b/precise/minecraft/hooks/install index 5da4ea5..96152c2 100755 --- a/precise/minecraft/hooks/install +++ b/precise/minecraft/hooks/install @@ -6,7 +6,7 @@ set -eux # -x for verbose logging to juju debug-log apt-get -y install openjdk-7-jre-headless ## For tectonicus -apt-get -y install subversion +#apt-get -y install subversion INSTALL_DIR=/opt/apps/minecraft @@ -14,6 +14,6 @@ mkdir -p $INSTALL_DIR wget https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft_server.jar -O $INSTALL_DIR/minecraft_server.jar -cp etc/init/minecraft /etc/init/minecraft +cp etc/init/minecraft.conf /etc/init/minecraft.conf