Commit 82441c4c authored by Łukasz Nowak's avatar Łukasz Nowak

- merge instance and site creation in one step

Work in progress.

Zope and site are controlled by common set of parameters. It is understood that
Zeo will behave slightly different but in case of standalone instance it is
better to not have two different steps to do one thing. Zeo support shall be
plugged between creation of instance and site itself.



git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32510 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c3620ed3
......@@ -8,14 +8,15 @@ parts +=
products-other
products-erp5
zope-instance
create_erp5_site
# use locally developed recipe
develop = recipes/erp5.recipe.standaloneinstance
[zope-instance]
recipe = erp5.recipe.standaloneinstance
zope2-location = ${software_definition:zope_software}
debug-mode = on
location = ${buildout:var-directory}/zope-instance
eggs +=
ipdb
pysvn
......@@ -31,7 +32,6 @@ products =
${products-other:location}
${products-development:location}
[create_erp5_site]
# modify this to reflect your local mysql configuration
# Format:
# database[@host[:port]] [user [password [unix_socket]]]
......@@ -39,11 +39,10 @@ products =
mysql_database_name = development_site
erp5_sql_connection_string = ${:mysql_database_name}@${configuration:mysql_host}:${configuration:mysql_port} root
bt5-path = ${bt5-erp5:location}
bt5 =
erp5_base
erp5_forge
# for now override control script
control-script = ${zope-instance:location}/bin/zopectl
[requirements]
binary +=
......
......@@ -32,6 +32,7 @@ setup(
namespace_packages = ['erp5', 'erp5.recipe'],
install_requires = [
'erp5.recipe.zope2instance',
'erp5.recipe.createsite',
],
zip_safe=False,
entry_points = {'zc.buildout': ['default = %s:Recipe' % name]},
......
......@@ -2,16 +2,20 @@
import os
import zc.buildout
import erp5.recipe.zope2instance
import erp5.recipe.createsite
class Recipe(erp5.recipe.zope2instance.Recipe):
class Recipe(erp5.recipe.zope2instance.Recipe, erp5.recipe.createsite.Recipe):
def __init__(self, buildout, name, options):
standalone_location = options.get('location')
if not standalone_location:
raise zc.buildout.UserError('Location have to be specified')
options['control-script'] = options.get('control-script',
os.path.join(standalone_location, 'bin', 'zopectl'))
erp5.recipe.createsite.Recipe.__init__(self, buildout, name, options)
self.egg = zc.recipe.egg.Egg(buildout, options['recipe'], options)
self.buildout, self.options, self.name = buildout, options, name
self.zope2_location = options.get('zope2-location', '')
standalone_location = options.get('location')
if not standalone_location:
raise zc.buildout.UserError('Location have to be specified')
options['bin-directory'] = os.path.join(standalone_location, 'bin')
options['scripts'] = '' # suppress script generation.
options['file-storage'] = options.get('file-storage',
......@@ -30,10 +34,17 @@ class Recipe(erp5.recipe.zope2instance.Recipe):
assert relative_paths == 'false'
def install(self):
# initalise zope instance
erp5.recipe.zope2instance.Recipe.install(self)
# initialise ERP5 part
erp5.recipe.createsite.Recipe.install(self)
# we return nothing, as this is totally standalone installation
return []
def build_zope_conf(self):
# preparation for further fixing (chroot everything inside instance, etc)
erp5.recipe.zope2instance.Recipe.build_zope_conf(self)
def update(self):
return erp5.recipe.zope2instance.Recipe.update(self)
# adapt https://svn.erp5.org/repos/public/experimental/erp5.buildout
[buildout]
develop = recipes/erp5.recipe.standaloneinstance
parts = zope-instance
[zope-instance]
recipe = erp5.recipe.zope2instance
depends = ${create_mysql_database:command}
recipe = erp5.recipe.standaloneinstance
zope2-location = ${software_definition:zope_software}
user = zope:zope
http-address = 18080
debug-mode = off
control-script = zopectl
#Only for zope2.8
default-zpublisher-encoding =
zope-conf-additional=
......@@ -36,20 +40,15 @@ products =
${products-erp5:location}
${products-other:location}
portal_id = erp5
bt5-path = ${bt5-erp5:location}
bt5 =
[create_mysql_database]
# XXX: This have to be converted into recipe
recipe = plone.recipe.command
command =
echo "CREATE DATABASE IF NOT EXISTS ${create_erp5_site:mysql_database_name} DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci" | ${buildout:data-bin-directory}/mysql -u root
[create_erp5_site]
depends = ${create_mysql_database:command}
recipe = erp5.recipe.createsite
portal_id = erp5
control-script = ${zope-instance:control-script}
user = ${zope-instance:user}
bt5-path = ${bt5-erp5:location}
bt5 =
echo "CREATE DATABASE IF NOT EXISTS ${zope-instance:mysql_database_name} DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci" | ${buildout:data-bin-directory}/mysql -u root
[bt5list]
recipe = erp5.recipe.genbt5list
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment