CanastaWiki / Canasta

MediaWiki Docker image for Canasta, an all-in-one MediaWiki stack for easy deployment and management of enterprise-ready MediaWiki on production environments.
https://www.canasta.wiki
MIT License
38 stars 28 forks source link

Allow custom shell scripts to be defined by derivative images and have Canasta run them at both compile time and runtime #353

Closed jeffw16 closed 7 months ago

yaronkoren commented 9 months ago

This is already possible for runtime, no? Just add them to the maintenance-scripts/ directory?

jeffw16 commented 9 months ago

Well, yes, except I think today you closed the PR without merging it that would've actually fixed this issue. Right now, the scripts are being called manually.

Also, there needs to be a way to run the runtime scripts on startup only, not over and over again on a cron like maintenance-scripts does.

yaronkoren commented 9 months ago

Ooh - what was the PR? I didn't think there was anything useful among the stuff I closed.

jeffw16 commented 9 months ago

269

yaronkoren commented 9 months ago

Oh, okay. But please check the relevant code in run-apache.sh (a script that will hopefully be renamed soon, but that's another story) - I think you may have the wrong impression about what it currently does:

https://github.com/CanastaWiki/Canasta/blob/master/_sources/scripts/run-apache.sh#L103

jeffw16 commented 9 months ago

I still think my comment is relevant. What if a derivative image needed to add their own maintenance script? They should be able to do so, and they should be able to control the order in which the scripts run.

yaronkoren commented 9 months ago

Well, we can talk about setting the order - but what does that have to do with this issue? It doesn't say anything about order of operation.

jeffw16 commented 8 months ago

I think it's an implied nonnegotiable prerequisite that the scripts should be run in a well-ordered manner. We don't want nondeterministic script runs!

yaronkoren commented 8 months ago

Well, they're run in alphabetical order, so it's not nondeterministic... is that good enough? I hope so, because that's how things are done right now. :)

jeffw16 commented 7 months ago

They are? But I thought the PR to do that was closed without being merged, much to my dismay :(

yaronkoren commented 7 months ago

Okay - run-all.sh (until recently known as run-apache.sh) uses the "find" command to traverse through all the sripts in maintenance-scripts/ - I thought that "find" always returned files in alphabetical order, but as I just found out, apparently it only usually does that - there's no guarantee of the order unless you then run "sort" or something. Anyway, if you think the current approach to sorting should change, you should either create a different issue for it, or rename this issue - it's very confusing to have a discussion here about functionality that's not discussed in either the issue title or description.

jeffw16 commented 7 months ago

Closing this -

jeffw16 commented 7 months ago

I should add that we still need to alphabetize the order in which the maintenance-scripts/ files are run.