{ "info": { "author": "Rafael Oliveira", "author_email": "rafaelbco@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout", "Framework :: Buildout :: Recipe", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Build Tools" ], "description": ".. image:: https://travis-ci.org/collective/collective.recipe.zopeinstancemultiplier.svg?branch=master\n :target: https://travis-ci.org/collective/collective.recipe.zopeinstancemultiplier\n :alt: Build status\n\nOverview\n========\n\nThis recipe makes it easier to configure multiple Zope instances.\n\n\nExample usage\n=============\n\nWe'll start by creating a buildout that uses the recipe::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = instance instance-multiplier\n ...\n ... [instance]\n ... recipe = collective.recipe.zopeinstancemultiplier:printer\n ... http-address = 8080\n ... option-foo = value-foo\n ... option-bar = value-bar\n ...\n ... [instance-multiplier]\n ... recipe = collective.recipe.zopeinstancemultiplier\n ... instance-part = instance\n ... count = 2\n ... \"\"\")\n\n\nThe ``instance-multiplier`` part is configured to generate two additional parts,\nusing the ``instance`` part as a model. Two new parts will be created: ``instance-1`` and\n``instance-2``. These parts will be exact clones of the model part, except for the\n``http-address`` option, which will be incremented for each part. As a result we we'll have:\n\n* ``instance`` with ``http-address`` equals ``8080``.\n* ``instance-1`` with ``http-address`` equals ``8081``.\n* ``instance-2`` with ``http-address`` equals ``8082``.\n\nThe ``:printer`` recipe just prints out the part options at install time. We don't want to\ngenerate real Zope instances just to test. In real life you would use\n`plone.recipe.zope2instance`_.\n\nRunning the buildout gives us::\n\n >>> print 'start', system(buildout)\n start...\n Installing instance.\n http-address = 8080\n option-bar = value-bar\n option-foo = value-foo\n Installing instance-1.\n http-address = 8081\n option-bar = value-bar\n option-foo = value-foo\n Installing instance-2.\n http-address = 8082\n option-bar = value-bar\n option-foo = value-foo\n ...\n\n\nSupport for \"ip:port\" syntax\n============================\n\nThe \"ip:port\" syntax in the ``http-address`` option is also supported::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = my-instance my-instance-multiplier\n ...\n ... [my-instance]\n ... recipe = collective.recipe.zopeinstancemultiplier:printer\n ... http-address = 127.0.0.1:1234\n ...\n ... [my-instance-multiplier]\n ... recipe = collective.recipe.zopeinstancemultiplier\n ... instance-part = my-instance\n ... count = 2\n ... \"\"\")\n\nRunning the buildout gives us::\n\n >>> print 'start', system(buildout)\n start...\n Installing my-instance.\n http-address = 127.0.0.1:1234\n Installing my-instance-1.\n http-address = 127.0.0.1:1235\n Installing my-instance-2.\n http-address = 127.0.0.1:1236\n ...\n\n\nAdding a custom instance\n========================\n\nSometimes you want to have a custom instance in your cluster. To make configuration easier\nthe \"multiplier\" part provides an special option containing the next port to be used. You can\nuse this option like this::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = instance instance-multiplier instance-custom\n ...\n ... [instance]\n ... recipe = collective.recipe.zopeinstancemultiplier:printer\n ... http-address = 8080\n ...\n ... [instance-multiplier]\n ... recipe = collective.recipe.zopeinstancemultiplier\n ... instance-part = instance\n ... count = 2\n ...\n ... [instance-custom]\n ... <= instance\n ... http-address = ${instance-multiplier:next-http-address}\n ... custom-option = custom-value\n ... \"\"\")\n\nRunning the buildout gives us::\n\n >>> print 'start', system(buildout)\n start ...\n Installing instance.\n http-address = 8080\n Installing instance-1.\n http-address = 8081\n Installing instance-2.\n http-address = 8082\n ...\n Installing instance-custom.\n custom-option = custom-value\n http-address = 8083\n\n\nDepending on the name of the part (``${:_buildout_section_name}`` support)\n==========================================================================\n\nSometimes an option value must include the name of the part. Buildout supports this use case by\nproviding the special value ``_buildout_section_name_``.\n\nThe following example shows how this special value is used is commonly used in the multiple Zope\ninstances scenario, without using this recipe::\n\n [instance]\n ...\n http-address = 8080\n special-log-path = /path/to/the/logs/${:_buildout_section_name}.log\n\n [instance-1]\n <= instance\n http-address = 8081\n\n [instance-2]\n <= instance\n http-address = 8082\n\nAn attempt to adapt the previous example to work with this recipe would look like this::\n\n [instance]\n ...\n http-address = 8080\n special-log-path = /path/to/the/logs/${:_buildout_section_name}.log\n\n [instance-multiplier]\n recipe = collective.recipe.zopeinstancemultiplier\n instance-part = instance\n count = 2\n\nThis, however, would *fail*. Because the way Buildout works, at the time the recipe has access\nto the ``instance`` part to multiply it, the variable substitution would already have occurred.\n\nTo make it work a simple adaptation is needed. Simply include an extra dollar sign in order to\nescape the variable. Here's an example::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = instance instance-multiplier\n ...\n ... [instance]\n ... recipe = collective.recipe.zopeinstancemultiplier:printer\n ... http-address = 8080\n ... special-log-path = /path/to/the/logs/$${:_buildout_section_name_}.log\n ...\n ... [instance-multiplier]\n ... recipe = collective.recipe.zopeinstancemultiplier\n ... instance-part = instance\n ... count = 2\n ... \"\"\")\n\nRunning the buildout gives us::\n\n >>> print 'start', system(buildout)\n start ...\n Installing instance.\n http-address = 8080\n special-log-path = /path/to/the/logs/instance.log\n Installing instance-1.\n http-address = 8081\n special-log-path = /path/to/the/logs/instance-1.log\n Installing instance-2.\n http-address = 8082\n special-log-path = /path/to/the/logs/instance-2.log\n ...\n\n.. References:\n.. _`plone.recipe.zope2instance`: https://pypi.python.org/pypi/plone.recipe.zope2instance\n\nChangelog\n=========\n\n0.1.0 (2017-07-18)\n------------------\n\n- Add support for the ``_buildout_section_name`` special variable.\n\n\n0.0.2 (2017-07-17)\n------------------\n\n- Fix description in ``setup.py``.\n\n\n0.0.1 (2017-07-17)\n------------------\n\n- First release.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/collective/collective.recipe.zopeinstancemultiplier", "keywords": "zc.buildout buildout recipe supervisor", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "collective.recipe.zopeinstancemultiplier", "package_url": "https://pypi.org/project/collective.recipe.zopeinstancemultiplier/", "platform": "", "project_url": "https://pypi.org/project/collective.recipe.zopeinstancemultiplier/", "project_urls": { "Homepage": "https://github.com/collective/collective.recipe.zopeinstancemultiplier" }, "release_url": "https://pypi.org/project/collective.recipe.zopeinstancemultiplier/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Makes it easier to configure multiple Zope instances.", "version": "0.1.0" }, "last_serial": 3032354, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "c458cbdc3b464548ad8047584fc21235", "sha256": "133c4f2f84a442b8533cace39adde465c2e73e4c5d9e3efb99bf30d09729d74d" }, "downloads": -1, "filename": "collective.recipe.zopeinstancemultiplier-0.0.1.tar.gz", "has_sig": false, "md5_digest": "c458cbdc3b464548ad8047584fc21235", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5107, "upload_time": "2017-07-17T21:06:10", "url": "https://files.pythonhosted.org/packages/c0/88/4001d75671e322ec2ea3acbdfe665e139af91936a1b9cffca9a43bd15e35/collective.recipe.zopeinstancemultiplier-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "1ba203abe8f5471b927757ab52c963b6", "sha256": "2cc994ebe4722a5bf6ffea487fc5a7103f1bbb4c4bdbe22bbdd69f619265140a" }, "downloads": -1, "filename": "collective.recipe.zopeinstancemultiplier-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1ba203abe8f5471b927757ab52c963b6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5718, "upload_time": "2017-07-17T21:10:14", "url": "https://files.pythonhosted.org/packages/af/6c/8b89cfdf268abb00bff5215093df65eb8eb164083f23978b8fb583e4cd19/collective.recipe.zopeinstancemultiplier-0.0.2.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "df7e98c933c754ca340823b92535c7a4", "sha256": "efa10e50769218fca1d04e363c8d9ba3476e48f0977b9373be34d1214b65d54c" }, "downloads": -1, "filename": "collective.recipe.zopeinstancemultiplier-0.1.0.tar.gz", "has_sig": false, "md5_digest": "df7e98c933c754ca340823b92535c7a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6614, "upload_time": "2017-07-18T20:02:23", "url": "https://files.pythonhosted.org/packages/9a/b8/6b5ff28cdf067f5d4434e0e2e3f5560de7b1da43e9d8da6a44f876ddcd94/collective.recipe.zopeinstancemultiplier-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "df7e98c933c754ca340823b92535c7a4", "sha256": "efa10e50769218fca1d04e363c8d9ba3476e48f0977b9373be34d1214b65d54c" }, "downloads": -1, "filename": "collective.recipe.zopeinstancemultiplier-0.1.0.tar.gz", "has_sig": false, "md5_digest": "df7e98c933c754ca340823b92535c7a4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6614, "upload_time": "2017-07-18T20:02:23", "url": "https://files.pythonhosted.org/packages/9a/b8/6b5ff28cdf067f5d4434e0e2e3f5560de7b1da43e9d8da6a44f876ddcd94/collective.recipe.zopeinstancemultiplier-0.1.0.tar.gz" } ] }