Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add installation script(s) #17

Open
Toxocious opened this issue Apr 8, 2023 · 4 comments
Open

Add installation script(s) #17

Toxocious opened this issue Apr 8, 2023 · 4 comments
Assignees

Comments

@Toxocious
Copy link
Owner

Create an installation script to handle setting up and configuring the server.

  1. Move game source code into /src
  2. Place configuration files in /config
  • Nginx config
  1. Keep non-critical files in / (.md, .sh, etc)

Have the script do the following tasks:

It is assumed that you have cloned this repository before running the script.

  • Prompt what to NAME the game
  • Prompt where to put the game files in the server's file-system
  • Move the ./src folder to the specified DIRECTORY
  • Rename ./src to NAME
  • Install PHP 7.4 on the server
  • Install MySQL on the server
  • Move configuration files to the correct directories
  • Prompt what username to name MySQL user account
  • Prompt what password to give MySQL user account
  • Prompt to reconfirm password from previous prompt
  • Create MySQL user absolute with username and password from prior prompts
  • Set cwd to ../DIRECTORY
  • Clone the Absolute Database repository to ./INIT_DATABASE
  • Set cwd to ./INIT_DATABASE
  • Loop through all *.sql files in the directory and execute them through MySQL CLI
  • Display RPG admin login credentials
    • These are pre-baked into the users table for convenience

Potentially have the installation script clone and install both the in-game chat system and the discord bot?

@Toxocious Toxocious self-assigned this Apr 8, 2023
@Toxocious
Copy link
Owner Author

Likely to be closed and not implemented once Docker has been set-up in the docker-implementation branch.

@Toxocious
Copy link
Owner Author

I retract my previous comment.

We can still use an installation script (./start.sh) that handles building/starting Docker container(s) for Absolute.

./start.sh

  • Automatically clones Absolute Database repository and runs a migration.php script to initialize the default database required to operate the RPG
  • Prompt user to clone Absolute Chat repository
    • If yes, clone it and use its AbsoluteChat.dockerfile to handle running it in a separate container
  • Prompt user to clone Absolute Discord Bot repository
    • If yes, clone it and use its AbsoluteDiscordBot.dockerfile to handle running it in a separate container

@Toxocious
Copy link
Owner Author

With the recent commit refactor ./start.sh, we now have a script that sets up a server for Absolute.

It generates SSL certs, builds and spins up docker containers, and runs all needed SQL migrations to have an up-to-date database.

Since we're going the route of using migrations, the Absolute Database repository will end up being deleted as it is no longer needed.

The next step is to integrate the chat-system and discord bot into the docker configuration that we're currently using.

Currently thinking about integrating these by having the start.sh script clone each repository and spin up docker containers for each of them or something - this depends on if I end up rewriting the chat system to actually build dist files for both the server and client.

@Toxocious
Copy link
Owner Author

I have added Absolute's Discord bot to our Docker configuration. It now runs automatically when the ./start.sh script has been run.

I will be adding Absolute's chat system to the Docker configuration in the coming days after refactoring it and rewriting the client-side code in TypeScript.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

No branches or pull requests

1 participant