-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
working plone buildout, make separate zope app
- Loading branch information
Showing
8 changed files
with
187 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
bin | ||
lib | ||
include | ||
distribute*.gz | ||
.installed.cfg | ||
.mr.developer.cfg | ||
develop-eggs | ||
eggs | ||
var | ||
*.pyc | ||
*.egg-info | ||
src | ||
parts | ||
.ropeproject |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
=========================== | ||
Run Plone CMS on Appsembler | ||
=========================== | ||
|
||
This is a simple buildout which uses Stackato's filesystem service for | ||
persistence. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') |