Compare commits

...

4 commits

Author SHA1 Message Date
finga b34f8d6b14 Release first version
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-04-24 18:23:33 +02:00
finga 279ffb7b95 ci: Remove redundant CI jobs
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
All those checks should be executed by `cargo-checkmate` anyway.
2022-04-24 18:23:33 +02:00
finga 2a414a9b05 ci: Also build a Debian package with cargo-deb
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-04-24 18:23:33 +02:00
finga dc3f58f3f3 Extend Cargo.toml and Readme.md
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
2022-04-24 18:23:33 +02:00
4 changed files with 54 additions and 30 deletions

View file

@ -1,36 +1,18 @@
pipeline:
fmt:
group: default
image: rust_full
commands:
- cargo fmt --all -- --check
clippy:
group: default
image: rust_full
commands:
- cargo clippy --all-features
doc:
group: default
image: rust_full
commands:
- cargo doc --all-features
checkmate:
group: default
image: rust_full
commands:
- cargo checkmate
build:
group: default
image: rust_full
commands:
- cargo build --all-features
build_release:
group: default
image: rust_full
commands:
- cargo build --all-features --release
build_deb:
group: default
image: rust_full
commands:
- cargo deb

2
Cargo.lock generated
View file

@ -436,7 +436,7 @@ dependencies = [
[[package]]
name = "mightyohm-gc-exporter"
version = "0.1.0-dev"
version = "0.1.0"
dependencies = [
"anyhow",
"axum",

View file

@ -1,8 +1,10 @@
[package]
name = "mightyohm-gc-exporter"
version = "0.1.0-dev"
version = "0.1.0"
authors = ["finga <finga@onders.org>"]
edition = "2021"
description = "Prometheus exporter for the MightyOhm Geiger Counter"
description = "Prometheus exporter for the MightyOhm Geiger Counter."
readme = "README.md"
license = "GPL-3.0-or-later"
repository = "https://git.onders.org/finga/mightyohm-gc-exporter"
keywords = ["prometheus", "metrics"]

View file

@ -2,14 +2,54 @@
A Prometheus exporter for the [MightyOhm Geiger Counter](https://mightyohm.com/blog/products/geiger-counter/).
## Build
Cargo, the Rust package manager, is used to build this project.
### Same architecture as system
To compile it for the same architecture as the build system:
Compile it for the same architecture as the build system:
```sh
cargo build --release
```
### Cross-compile for aarch64 (recent RaspberryPi)
To cross-compile it for RaspberryPi:
### Cross-compile for amd64 (recent RaspberryPi)
Cross-compile it for the amd64 architecture:
```sh
PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo build --target aarch64-unknown-linux-gnu --release
```
## Debian
If this should be built for Debian, Raspbian,
etc.. [`cargo-deb`](https://crates.io/crates/cargo-deb) can be used to
build the package.
The Debian package comes with an automatically started and enabled
systemd service unit which can be configured via
`/etc/default/mightyohm-gc-exporter`.
### Same architecture as system
Build a `deb` package for the same architecture as the build system:
```sh
cargo deb
```
### Cross-compile for amd64 (recent RaspberryPi)
Build a `deb` package for the amd64 architecture:
```sh
PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu cargo deb --target aarch64-unknown-linux-gnu
```
## Usage
```
USAGE:
mightyohm-gc-exporter [OPTIONS]
OPTIONS:
-a, --address <ADDRESS> The IPv4 or IPv6 address where the metrics are served
[default: 127.0.0.1]
-b, --baud-rate <BAUD_RATE> The baudrate of the serial connection [default: 9600]
-h, --help Print help information
-p, --port <PORT> The port where the metrics are served [default: 9111]
-s, --serial-port <SERIAL_PORT> The port of the serial device, usually in '/dev/...'
[default: /dev/serial0]
-t, --timeout <TIMEOUT> Timeout of the serial connection in ms [default: 1000]
-V, --version Print version information
```