Sarjuuk / aowow

Database viewer for TrinityCore based on aowow by @LordJZ, based on the JS-Engine of Wowhead
204 stars 217 forks source link

Question: Non-interactive setup #425

Closed jzizka91 closed 4 months ago

jzizka91 commented 4 months ago

Hi.

Just a question. Is it possible to run the php aowow --setup in a non-interactively mode or would it be possible to implement it? It would be useful for automatic deployments.

System:

Sarjuuk commented 4 months ago

That's not something i've considered so far. And at least for now i don't think wil implement.

But there are only a couple of steps that actually require user input, though generally if there is any error there will be a prompt.

https://github.com/Sarjuuk/aowow/blob/615c203c7a89176b5da977a87bd680e57162f6e7/setup/tools/clisetup/setup.us.php#L28-L35 You'd need to comment:

And barring any errors it should run without user input.

iTob191 commented 4 months ago

I think it's already possible to a reasonable degree. The most interactive steps are the first 2 (db and site config). You can skip those by creating a file cache/setup/firstrun with contents

37
2

and calling the setup like printf "y" | php aowow --setup. As sarjuuk has mentioned, this requires that you provide the database config file (config/config.php) and apply the needed database changes for site configuration yourself. With the recent changes in 10de3206167089a985dbfee9999469bbd86cc23c, the setup will no longer hang if user input is required when running in a non-interactive environment.

Info: 37 is the current aowow revision at the time of writing. If you try this at a later time you may need to update the number.

jzizka91 commented 4 months ago

Alright, I'll take a look. Thanks.