I have a batch job that I need to run occasionally against my Plone instance. It needs access to the code in my Plone product and other Plone code and to query the catalog. I've included the script in my Plone product and currently run it via
bin/instance run <path to script in eggs directory>
Obviously if a new version of my product comes along I need to change the path to point to the new version of the egg. What I'd like to do is define any entry point for the script in my product's setup.py and then use the buildout recipe like zc.recipe.egg
so that I can just run
bin/myscript
How do I do this and still provide my script access to the top level app
object and all the code installed in my Plone instance?