Development Guide
Building from Source
Prerequisites
- Rust and Cargo (latest stable version)
- Ookla Speedtest CLI version 1.2.0 or higher
Build Steps
# Clone the repository
git clone https://github.com/lpicanco/prometheus-speedtest-exporter.git
cd prometheus-speedtest-exporter
# Build in release mode
cargo build --release
# Run tests
cargo test
# Run linting
cargo clippy
Building Documentation
The documentation is built using MkDocs with the Material theme and hosted on GitHub Pages.
Directory Structure
docs/
├── mkdocs.yml # MkDocs configuration
└── src/ # Documentation source files
├── index.md # Home page
├── quick-start.md
└── ...
GitHub Pages Setup
- Go to your repository's Settings
- Navigate to "Pages" under "Code and automation" in the sidebar
- Under "Build and deployment":
- For "Source", select "Deploy from a branch"
- For "Branch", select
gh-pages
and/ (root)
- Click "Save"
After configuration, your documentation will be available at https://<username>.github.io/<repository>
.
Prerequisites
Local Development
Visit http://127.0.0.1:8000
to see the documentation.
Building for Production
The built site will be in the site
directory at the root of the project.
Docker Build
Local Build
# Build the image
docker build -t prometheus-speedtest-exporter .
# Run the container
docker run -p 9516:9516 prometheus-speedtest-exporter
Multi-architecture Build
# Set up buildx
docker buildx create --use
# Build and push for multiple architectures
docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t your-registry/prometheus-speedtest-exporter:latest .
Release Process
- Update version in
Cargo.toml
- Create and push a new tag:
- The GitHub Actions workflow will automatically:
- Create a GitHub release
- Build and upload binaries for all supported architectures
- Build and push Docker images
- Deploy documentation updates
Contributing
- Fork the repository
- Create your feature branch:
- Run tests and linting:
- Commit your changes:
- Push to the branch:
- Open a Pull Request