plone / plone.recipe.zope2instance

zc.buildout recipe to setup and configure a Zope 2 instance.
https://pypi.org/project/plone.recipe.zope2instance
6 stars 23 forks source link

Make any ctl script python-dotenv (.env files) aware #163

Closed sneridagh closed 3 years ago

sneridagh commented 3 years ago

Adds python-dotenv dependency, adds two level of awareness:

loads .env file, if any then if PLONE_ENV is present, loads the .env.PLONE_ENV file (if any)

So we can have a .env.production then running PLONE_ENV=production .bin/instance fg it loads the env file.

Volto is already .env files aware, it seems sensible that Plone also does it, specially after the @plone/installer-team decided to start using environment variables (a la docker) to setup the maximum number of things. ZConfig already allows configuration based in environment variables instead of hardcoded values, so it's the perfect match.

mister-roboto commented 3 years ago

@sneridagh thanks for creating this Pull Request and help improve Plone!

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.

Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:

@jenkins-plone-org please run jobs

With this simple comment all the jobs will be started automatically.

Happy hacking!

sneridagh commented 3 years ago

@jenkins-plone-org please run jobs

sneridagh commented 3 years ago

Meh, the jobs fails and I can't run the tests locally... and I have no clue how the added things could make things fail...

tisto commented 3 years ago

@sneridagh if I am not mistaken you need to add the new dependency to https://github.com/plone/plone.recipe.zope2instance/blob/master/requirements-testing-zope-5.txt.

The test dependencies in a buildout recipe are not automatically resolved and need to be added explicitly.

tisto commented 3 years ago

@sneridagh ok, seems I was wrong. No clue what's wrong there. Maybe @jensens can help here...

tisto commented 3 years ago

@jensens @mauritsvanrees seems like the test failures have nothing to do with this PR. I re-ran the last green build and now it is red: https://github.com/plone/plone.recipe.zope2instance/runs/2079481518?check_suite_focus=true