diff --git a/plone/buildout.cfg b/plone/buildout.cfg index 9901bde..f91e2a9 100644 --- a/plone/buildout.cfg +++ b/plone/buildout.cfg @@ -19,6 +19,7 @@ find-links = eggs = python-Levenshtein feedparser + pillow # Reference any eggs you are developing here, one per line # e.g.: develop = src/my.package @@ -38,6 +39,7 @@ debug-mode = off # e.g. eggs = Plone my.package eggs = ${buildout:eggs} + Plone # If you want to register ZCML slugs for any packages, list them here. # e.g. zcml = my.package my.other.package diff --git a/plone/stackato.yml b/plone/stackato.yml index 95733b4..9938c5e 100644 --- a/plone/stackato.yml +++ b/plone/stackato.yml @@ -1,12 +1,24 @@ name: plonecms -mem: 64M +mem: 256M instances: 1 framework: type: python +requirements: + ubuntu: + - build-essential + - libssl-dev + - libxml2-dev + - libxslt1-dev + - libbz2-dev + - libjpeg62-dev + - libreadline-gplv2-dev + - wv + - poppler-utils + hooks: pre-staging: - mkdir $STACKATO_FILESYSTEM/filestorage diff --git a/zope/.gitignore b/zope/.gitignore new file mode 100644 index 0000000..91e0c73 --- /dev/null +++ b/zope/.gitignore @@ -0,0 +1,14 @@ +bin +lib +include +distribute*.gz +.installed.cfg +.mr.developer.cfg +develop-eggs +eggs +var +*.pyc +*.egg-info +src +parts +.ropeproject diff --git a/zope/README.txt b/zope/README.txt new file mode 100644 index 0000000..720249e --- /dev/null +++ b/zope/README.txt @@ -0,0 +1,7 @@ +=========================== +Run Plone CMS on Appsembler +=========================== + +This is a simple buildout which uses Stackato's filesystem service for +persistence. + diff --git a/zope/bootstrap.py b/zope/bootstrap.py new file mode 100644 index 0000000..6d12142 --- /dev/null +++ b/zope/bootstrap.py @@ -0,0 +1,57 @@ +############################################################################## +# +# Copyright (c) 2006 Zope Corporation and Contributors. +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# +############################################################################## +"""Bootstrap a buildout-based project + +Simply run this script in a directory containing a buildout.cfg. +The script accepts buildout command-line options, so you can +use the -c option to specify an alternate configuration file. + +$Id: bootstrap.py 75593 2007-05-06 21:11:27Z jim $ +""" + +import os, shutil, sys, tempfile, urllib2 + +tmpeggs = tempfile.mkdtemp() + +try: + import pkg_resources +except ImportError: + ez = {} + exec urllib2.urlopen('http://peak.telecommunity.com/dist/ez_setup.py' + ).read() in ez + ez['use_setuptools'](to_dir=tmpeggs, download_delay=0) + + import pkg_resources + +cmd = 'from setuptools.command.easy_install import main; main()' +if sys.platform == 'win32': + cmd = '"%s"' % cmd # work around spawn lamosity on windows + +ws = pkg_resources.working_set +assert os.spawnle( + os.P_WAIT, sys.executable, sys.executable, + '-c', cmd, '-mqNxd', tmpeggs, + '--index=http://karlhosting.github.com/2/production/index/', + 'zc.buildout==1.4.3', + dict(os.environ, + PYTHONPATH= + ws.find(pkg_resources.Requirement.parse('setuptools')).location + ), + ) == 0 + +ws.add_entry(tmpeggs) +ws.require('zc.buildout') +import zc.buildout.buildout +zc.buildout.buildout.main(sys.argv[1:] + ['bootstrap']) +shutil.rmtree(tmpeggs) diff --git a/zope/buildout.cfg b/zope/buildout.cfg new file mode 100644 index 0000000..9901bde --- /dev/null +++ b/zope/buildout.cfg @@ -0,0 +1,45 @@ +[buildout] +#relative-paths = true + +parts = + instance + +# Change the number here to change the version of Plone being used +extends = + http://dist.plone.org/release/4.1.4/versions.cfg +versions = versions + +# Add additional egg download sources here. dist.plone.org contains archives +# of Plone packages. +find-links = + http://dist.plone.org/release/4.1.4 + http://dist.plone.org/thirdparty + +# Add additional eggs here +eggs = + python-Levenshtein + feedparser + +# Reference any eggs you are developing here, one per line +# e.g.: develop = src/my.package +develop = + +[instance] +# For more information on this step and configuration options see: +# http://pypi.python.org/pypi/plone.recipe.zope2instance +recipe = plone.recipe.zope2instance +user = admin:admin +zeo-client = false +http-address = PLONE_HTTP_PORT +debug-mode = off + +# If you want Zope to know about any additional eggs, list them here. +# This should include any development eggs you listed in develop-eggs above, +# e.g. eggs = Plone my.package +eggs = + ${buildout:eggs} + +# If you want to register ZCML slugs for any packages, list them here. +# e.g. zcml = my.package my.other.package +zcml = + diff --git a/zope/stackato.yml b/zope/stackato.yml new file mode 100644 index 0000000..e00f1a8 --- /dev/null +++ b/zope/stackato.yml @@ -0,0 +1,32 @@ +name: zope2 + +mem: 64M + +instances: 1 + +framework: + type: python + +hooks: + pre-staging: + - mkdir $STACKATO_FILESYSTEM/filestorage + - mkdir $STACKATO_FILESYSTEM/blobstorage + post-staging: + - virtualenv . + - bin/python bootstrap.py + - bin/buildout + pre-running: + - rm -rf var/filestorage + - rm -rf var/blobstorage + - ln -s $STACKATO_FILESYSTEM/filestorage var/filestorage + - ln -s $STACKATO_FILESYSTEM/blobstorage var/blobstorage + +services: + filesystem: datafs + +processes: + web: python2.7 start_plone.py + +ignores: + - .git + - .pyc diff --git a/zope/start_plone.py b/zope/start_plone.py new file mode 100644 index 0000000..0e43e7d --- /dev/null +++ b/zope/start_plone.py @@ -0,0 +1,17 @@ +import os + +def setup_instance(): + port = os.getenv('VCAP_APP_PORT', '8080') + host = os.getenv('VCAP_APP_HOST', '0.0.0.0') + + instances_file = open('parts/instance/etc/zope.conf') + instances_file_content = instances_file.read().replace('PLONE_HTTP_PORT', port) + instances_file.close() + + new_instances_file = open('parts/instance/etc/zope.conf', 'w') + new_instances_file.write(instances_file_content) + new_instances_file.close() + +if __name__ == '__main__': + setup_instance() + os.execl('bin/instance', 'instance', 'fg')