Skip to content

Commit e87c3c4

Browse files
committed
README: Update usage and deployment docs
1 parent 3aa1c10 commit e87c3c4

1 file changed

Lines changed: 37 additions & 13 deletions

File tree

README.md

Lines changed: 37 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ Cache files (will be created if necessary):
4747
* `pretix_cache.json`: Local cache of Pretix ticket data
4848
* `schedule_cache.json`: Local cache of [programapi](https://github.com/europython/programapi) schedule
4949

50-
## Setup
51-
### Quickstart using `pip`
50+
## Usage
5251

53-
If you just want to try the bot and skip the development setup, you can use `pip` (requires Python >= 3.11):
52+
This section describes how to install and run the bot.
53+
Please see below for development and EuroPython-specific deployment instructions.
54+
55+
With pip:
5456

5557
```shell
5658
# create and activate virtual environment (optional, but recommended)
@@ -65,10 +67,24 @@ export DISCORD_BOT_TOKEN=... # Windows: $env:DISCORD_BOT_TOKEN = '...'
6567
export PRETIX_TOKEN=... # Windows: $env:PRETIX_TOKEN = '...'
6668

6769
# run the bot with a given config file
68-
run-bot --config your-config-file.toml
70+
run-bot --config-file your-config-file.toml
71+
```
72+
73+
With uv:
74+
75+
```shell
76+
# install dependencies in virtual environment
77+
uv sync
78+
79+
# set environment variables
80+
export DISCORD_BOT_TOKEN=... # Windows: $env:DISCORD_BOT_TOKEN = '...'
81+
export PRETIX_TOKEN=... # Windows: $env:PRETIX_TOKEN = '...'
82+
83+
# run the bot with a given config file
84+
uv run run-bot --config-file your-config-file.toml
6985
```
7086

71-
### Full Development Setup
87+
## Full Development Setup
7288

7389
* Install `uv` as documented [here](https://docs.astral.sh/uv/getting-started/installation/).
7490
* Run `uv sync --dev` to create/update a virtual environment with all dependencies according to [`uv.lock`](./uv.lock).
@@ -87,7 +103,7 @@ export PRETIX_TOKEN=... # Windows: $env:PRETIX_TOKEN = '...'
87103
run-bot --config your-config-file.toml
88104
```
89105

90-
#### Working with `uv`
106+
### Working with `uv`
91107

92108
This is a list of useful commands when working with `uv`.
93109
Please refer to the [uv documentation](https://docs.astral.sh/uv) or `uv help` for details.
@@ -123,15 +139,23 @@ uv remove [package]
123139
* Check code style: `ruff check .`
124140
* Run tests: `pytest`
125141

126-
### Deployment
142+
## Deployment
127143

128-
The bot is deployed on a VPS using a GitHub Action.
144+
For the EuroPython conference, this bot is deployed on a VPS.
129145
It uses Ansible to configure the VPS, and Docker Compose to run the bot.
146+
The deployment process is executed via a GitHub Action.
130147

131148
Related files:
132149

133-
* [.github/workflows/deploy.yml](./.github/workflows/deploy.yml): The GitHub Action
134-
* [ansible/deploy-playbook.yml](./ansible/deploy-playbook.yml): The Ansible Playbook
135-
* [Dockerfile](./Dockerfile): The Docker container recipe
136-
* [compose.yaml](./compose.yaml): The Docker Compose recipe
137-
* [prod-config.toml](./prod-config.toml): The Prod bot configuration
150+
* In this repository:
151+
* [.github/workflows/deploy.yml](./.github/workflows/deploy.yml): GitHub Action
152+
* [ansible/deploy-playbook.yml](./ansible/deploy-playbook.yml): Ansible Playbook
153+
* [Dockerfile](./Dockerfile): Docker container recipe
154+
* [compose.yaml](./compose.yaml): Docker Compose recipe
155+
* [prod-config.toml](./prod-config.toml): Prod bot configuration
156+
* On the VPS:
157+
* `/root/.secrets`: Contains `DISCORD_BOT_TOKEN` and `PRETIX_TOKEN`
158+
* `/root/livestreams.toml`: Livestream URL configuration
159+
* `/home/bot/registered_log.txt`: Registration log
160+
* `/home/bot/pretix_cache.json`: Pretix cache
161+
* `/home/bot/schedule_cache.json`: Program cache

0 commit comments

Comments
 (0)