Skip to content

devsfromasia/DevcordBot

 
 

Repository files navigation

DevcordBot

setup dev environment

  • copy .env.example to .env
  • enter at minimum DISCORD_TOKEN and GUILD_ID (and all you want to test)
  • start the dev database > docker-compose -f docker-compose.develop.yml up -d
  • enter the database information
    • DATABASE_HOST="localhost"
    • DATABASE="postgres"
    • DATABASE_USERNAME="postgres"
    • DATABASE_PASSWORD="DevcordRoxx2020"
  • enable pg_trgm for the database
    • enter docker exec -it test-db bash to access the docker image's bash shell
    • switch the user to postgres with su postgres
    • enter psql to access the postgres database and run CREATE EXTENSION pg_trgm; to install the required postgres extension pg_trgm
    • exit the image's bash shell
  • the bot is now ready to start

setup productive environment

  • copy .env.example to .env
  • enter all properties
  • run docker-compose up -d

setup redeploy command

We recommend this library for the redeployment of the bot. Simply setup the webhook for executing docker-compose pull && docker-compose up -d in the directory where you have the docker-compose.yml and .env file. Then enter the webhook URL at REDEPLOY_HOST and the Token at REDEPLOY_TOKEN. Example Config:

{
    "id": "redeploy-devcordbot",
    "execute-command": "/path/to/devcordbot/redeploy.sh",
    "command-working-directory": "/path/to/devcordbot",
    "trigger-rule":
    {
      "match":
      {
        "type": "value",
        "value": "YOUR_SECRET_TOKEN",
        "parameter":
        {
          "source": "header",
          "name": "Redeploy-Token"
        }
      }
    }
  }

redeploy.sh:

#!/bin/sh
docker-compose pull && docker-compose up -d

About

Bot for the DevCord Discord server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%