ASKBOT / askbot-devel

Askbot is a Django/Python Q&A forum. **Contributors README**: https://github.com/ASKBOT/askbot-devel#how-to-contribute. Commercial hosting of Askbot and support are available at https://askbot.com
Other
1.56k stars 627 forks source link

Commited WiP files for publication #833

Closed martin-bts closed 4 years ago

martin-bts commented 5 years ago
evgenyfadeev commented 5 years ago

Re: overwriting files by the install script - I agree, it's not necessary, we should just tell them - either reconcile the files manually or choose a new directory.

On the directory structure: imo as default solution your proposal works, but I would leave an option to specify custom locations of docs, cron, upfiles, logs. (docs may be suppressed, because not everyone needs them)

Also I have quite a strong wish in the default directory structure to move "cron", "upfiles", "docs" dirs directly alongside with the manage.py. It's just that flatter is better than nested;).

Thank you for your effort!

martin-bts commented 5 years ago

When we just look at creating files and directories, I think this is a viable approach. I added unittests that suggests everything works just fine, if sensible parameters are provided. Still not done.

For best results this should be used/merged with https://github.com/ASKBOT/askbot-devel/pull/827. I haven't attempted this yet!

martin-bts commented 5 years ago

DO NOT MERGE THIS! THIS IS FOR REVIEW ONLY!

The logic seems in a pretty good state now. When I run tox -e setup the resulting file structure is:

deploy_askbot/
deploy_askbot/doc
deploy_askbot/cron
deploy_askbot/cron/send_email_alerts.sh
deploy_askbot/manage.py
deploy_askbot/deploy_askbot
deploy_askbot/deploy_askbot/django.wsgi
deploy_askbot/deploy_askbot/urls.py
deploy_askbot/deploy_askbot/__init__.py
deploy_askbot/deploy_askbot/celery_app.py
deploy_askbot/deploy_askbot/settings.py
deploy_askbot/static
deploy_askbot/upfiles
deploy_askbot/log
deploy_askbot/log/askbot.log

( static and doc pruned for readability)

There are nine unit tests that ensure the basic functionality of the DeployObjects and the predefined DeployableComponents. The output the installer generates is quite messy, but that is really just an optical issue.

This branch already includes @evgenyfadeev 's comment on changing the layout and the installer giving user feedback instead of overwriting existing files. askbot.deployment.AskbotSetup.deploy_askbot_new illustrates how the predefined DeployableComponent ProjectRoot is modified to include the log dir and file (askbot/deployment/__init__.py, lines 409-411, at the time of this writing). This very mechanism can be used to facilitate custom locations of docs, cron, upfiles, logs. However, this can only be sensibly implemented together with https://github.com/ASKBOT/askbot-devel/pull/827

I'll go ahead and create a new branch where I merge this branch and the one for #827.

martin-bts commented 4 years ago

Superceeded by https://github.com/ASKBOT/askbot-devel/pull/849