- Go 1.13
- Redis
- Discord account
- IEX Cloud account
- Alpaca account
- Docker
- Minikube (or some other Kubernetes cluster host)
- Kubernetes
cp .env.example .env
- Fill in
.env
with your credentials - Get your bot token from discord from here.
- Enable developer mode for Discord then right click channel or user to get ID.
- Grab your test/real tokens from https://iexcloud.io/console/
- Grab your Alpaca ID and SECRET KEY from https://app.alpaca.markets
- Create secrets with
kubectl create secrets generic <uri>
Create from file is easier
kubectl create secret generic botsecrets --from-env-file=.env
- Edit secrets with
kubectl edit secrets <uri>
- View secrets with
kubectl get secret <uri> -o jsonpath='{.data}'
Assuming you have exported ENV vars to your shell from .env you can now run tests with:
make test
Assuming you have filled in the .env
file you can now run tests with:
make test-in-docker
- Export ENV vars in .env to your shell
- Build the binary
make build-discord-bot
- Run the binary
make run-discord-bot
- Done
- Create a
.env
file see example. - Build docker image and run compose
make up
- Done
- Create a
.env
file see example. - Create secrets
kubectl create secret generic botsecrets --from-env-file=.env
- Create your cluster
minikube start
- Apply k8s deployment to cluster
kubectl apply -f k8s/k8s.yml
- Done
For every bot update the docker image needs to be bumped so that Kubernetes can get the latest image.
- Build and tag image
docker build -t jonwho/discord-bot:runbot-v{n} -f Dockerfile.runbot .
Where n is the bump number
- Push the image to Docker Hub
docker push jonwho/discord-bot:runbot-v{n}
heroku create
- Define your
heroku.yml
likeheroku.yml.example
- Commit heroku.yml
git add heroku.yml
git commit -m 'add heroku.yml'
- Set heroku stack to container
heroku stack:set container
- Deploy app
git push heroku master