Cog-Creators / Red-DiscordBot

A multi-function Discord bot
https://docs.discord.red
GNU General Public License v3.0
4.84k stars 2.31k forks source link

Automate deployment #5112

Open pgmillon opened 3 years ago

pgmillon commented 3 years ago

Type of feature request

Other

Description of the feature you're suggesting

As Red instance maintainer, I'd like to deploy a fully operational instance from scratch on a new node, including but not limited to:

1 - Core Red core can be easily installed automated using pip

2 - Cogs Cogs can only be installed using [p]cog install <repo> <cogs...> Suggestion: Something similar to pip's requirement with the list of cogs to install on startup given a --cogs-requirements flag is specified

repo/cog

3 - Community cogs Community cogs can only be install with both [p]repo add <repo> <ul> + [p]cog install <repo> <cogs...> Suggestion: Same as 2/ but it would be smarter to split with a --repositories-list flag to a file with a list of repos

repo https://...

4 - Config data If I want my new instance to be setup with some permissions, I need to start the instance with installed permission cog and then send a bunch of [p]permissions addglobalrule allow <command> <target>. Overwriting the settings.json file is not an options since data can be stored on a DB server. Suggestion: not much, maybe being able to specify a file with some startup commands

[p]permissions addglobalrule allow ...

Anything else?

No response

palmtree5 commented 3 years ago

I'm just making note of the current process for backup and restore (as per the [p]backup custom command in the main support server) here so that we may look at improvements as the current process (particularly on the restore side) is extremely inefficient, requiring a lot of user input to fully make the restore process happen that could potentially be automated

Current backup and restore process:

  1. Take note of the installed cog repositories with [p]load downloader then [p]repo list.
  2. Stop the bot, ideally with [p]shutdown.
  3. Run redbot-setup backup <instancename> in your venv.
  4. Copy the backup file to the new machine/location.
  5. Extract the file to a location of your choice (remember the full path and make sure that the user you are going to install/run Red under can access this path).
  6. Install Red as normal on the new machine/location.
  7. Run redbot-setup to create a new instance, except use the path you remembered above as your data path.
  8. Start your new instance.
  9. Re-add the Repos using the same names as before.
  10. Do [p]cog update
  11. Re-add any cogs that were not re-installed (you may have to uninstall them first as Downloader may think they are still installed) Note: The config (data) from cogs has been saved, but not the code itself.
Jackenmen commented 3 years ago

Point 2 and 3 might get addressed by #4063