The powerful Discord bot which powers the OTA (Ordinul Templierilor Azteci) Discord community. Written in Go.
bot-service
(Handles Discord interactions like new messages, slash commands, join events, reaction adding or removing, etc.)
mysql-db
(Containerised MySQL instance for local development)aztemusic-service
(Standalone music orchestrator bot application - see development here AzteMusic)aztemarket-service
(Standalone marketplace bot application - see development here AzteMarket)In order to run the application, a few prerequisites must be met.
.env
file saved in the root of the repository. (an example environment configuration can be seen in example.env)Aztebot
repository (For example, the folder Project
should contain both the Aztebot
and the Aztebot-Infrastructure
repository folders) At the moment, to propagate remote DB changes to the local dev environment, the Infrastructure
submodule has to be updated manually when there are changes in the remote source (e.g. a new migration file).
This can be done by running git submodule update --recursive --remote --init
in the root of this repository.
make up
command.
mysql-db
service has sucessfully started, run the DB migrations locally by executing the following commands from the root of this repository (requires Aztebot-Infrastructure as described in prerequisite #5)
make migrate-up-dry
make migrate-up
To bring down all the services, one can do so by running make down
.
This project will employ CI/CD through the use of GitHub Actions and Google Cloud.
Continuous integration is implemented through a workflow script which sets up a containerised service composition containing the Go environment and other dependencies (MySql, etc.) and then runs the internal logic tests on all pull request and pushes to main. The workflow file for the AzteBot CI can be seen in test.yml.
Continuous deployment is implemented through a workflow script which builds all the project artifacts and uploads them to Google Cloud Artifact Registry on pushes to the main branch. Additionally, a GKE pod is created with the new container image and ultimately executed upstream to run the apps. The workflow file for the AzteBot CD can be seen in deploy.yml.
Notes:
make update-envs
and decoded accordingly in the Actions workflows.cmd
folder -- contains the main entry point of the bot application (and it also contains the Dockerfile associated with it) that starts the connection to Discord and actions on the various events emitted by it.internal
folder -- has multiple folders, each one containing the various logic components that the Aztebot service needs including data models, interfaces, handlers and DB contexts.pkg
folder -- contains util packages which are leveraged across the entire project.