From e56ab24ccdd078c73befa13f9ab1f580cd97663a Mon Sep 17 00:00:00 2001 From: colin Date: Thu, 29 Feb 2024 00:38:01 +0000 Subject: [PATCH] Update README.md --- README.md | 54 +++++++++++++++++++++++++++++------------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index ab4dfc6..195604d 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,39 @@ - -# bench plugin +Based on the structure of the provided README example, here's how you can communicate the usage of the Docker container for compiling QMK firmware with Docker Compose, incorporating environment variables for dynamic behavior: + +# QMK Firmware Compiler + +Compile your QMK firmware easily with Docker. This setup allows you to compile firmware from a directory of source files at runtime, ensuring flexibility for various keyboard and keymap compilations. ## Docker Run -Run the Docker image using the `docker run` command, now including the `CMS_TYPE` environment variable for CMS-specific authentication: +To compile your QMK firmware using the `docker run` command, set up your environment by specifying the source directory and output path: -1. **Testing a Single URL with Concrete5 Authentication:** +1. **Compile Firmware from a Single Source Directory:** ```bash - docker run -e CMS_TYPE="Concrete5" -e URLS="http://example.com" -e USERNAME="user" -e PASSWORD="pass" git.nixc.us/colin/bench:production + docker run -v $(pwd)/data:/usr/src/app/data -v $(pwd)/bin:/usr/src/app/bin qmk-compiler ``` -2. **Testing Multiple URLs with Concrete5 Authentication:** + This command mounts your local `data` directory containing the QMK source files to the container's `/usr/src/app/data` directory and outputs the compiled firmware to your local `bin` directory. - ```bash - docker run -e CMS_TYPE="Concrete5" -e URLS="http://example.com,http://example2.com" -e USERNAME="user" -e PASSWORD="pass" git.nixc.us/colin/bench:production - ``` +## Docker Compose -### Docker Compose +To integrate this process with Docker Compose, you can define a service in your `docker-compose.yml` file. This approach allows you to specify volume mounts and environment variables for a more automated and repeatable compilation process. -Example `docker-compose.yml` file, now with `CMS_TYPE` to specify the CMS for authentication: +Example `docker-compose.yml` file for QMK firmware compilation: ```yaml version: '3' services: - apachebench: - image: git.nixc.us/colin/bench:production + qmk-compiler: + image: qmk-compiler + volumes: + - ./data:/usr/src/app/data # Mount the source directory + - ./bin:/usr/src/app/bin # Mount the output directory environment: - CMS_TYPE: "Concrete5" # Specify CMS type for authentication - URLS: "http://example.com,http://example2.com" # Comma-separated list of URLs - USERNAME: "user" # Basic auth username - PASSWORD: "pass" # Basic auth password - REQUESTS: 100 # Number of requests for Apache Bench - CONCURRENCY: 10 # Number of multiple requests to make at a time + - KEYBOARD=example_keyboard # Specify the keyboard name (optional) + - KEYMAP=default # Specify the keymap name (optional) ``` Run the service defined in the `docker-compose.yml` file with: @@ -44,10 +44,14 @@ docker-compose up ## Customizing the Configuration -To fine-tune your testing setup, adjust the following environment variables: +To customize your firmware compilation, you can adjust the following environment variables and volume mounts: -- `CMS_TYPE`: Specify the CMS type for CMS-specific authentication (e.g., "Concrete5"). -- `URLS`: Comma-separated list of URLs to test. -- `USERNAME` and `PASSWORD`: Credentials for HTTP Basic Authentication. -- `REQUESTS`: Number of requests to perform with Apache Bench. -- `CONCURRENCY`: Number of multiple requests to make at a time. \ No newline at end of file +- **Volumes:** + - Mount your source directory to `/usr/src/app/data` to provide the firmware source files. + - Mount your output directory to `/usr/src/app/bin` to retrieve the compiled firmware. + +- **Environment Variables (Optional):** + - `KEYBOARD`: Specify the keyboard for which the firmware is being compiled. This variable can be used in your `compile_firmware.sh` script to dynamically select the keyboard. + - `KEYMAP`: Specify the keymap to be compiled. Similar to `KEYBOARD`, this can be used in the script to select the appropriate keymap. + +This configuration allows for a highly flexible and repeatable process for compiling QMK firmware, accommodating various keyboards and keymaps by simply adjusting the mounted volumes and, optionally, setting environment variables for specific compilations. \ No newline at end of file