Skip to content

Commit

Permalink
add basic support for uptime-kuma v2 beta
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBoot committed Nov 14, 2024
1 parent 14d7608 commit e2bb2d1
Show file tree
Hide file tree
Showing 7 changed files with 296 additions and 9 deletions.
18 changes: 17 additions & 1 deletion .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,20 @@ jobs:
include:
- name: "ghcr.io/bigboot/autokuma"
dockerfile: Dockerfile
build_args: ""
tag_prefix: ""
- name: "ghcr.io/bigboot/kuma"
dockerfile: Dockerfile.cli
build_args: ""
tag_prefix: ""
- name: "ghcr.io/bigboot/autokuma"
dockerfile: Dockerfile
build_args: "FEATURES=uptime-kuma-v2"
tag_prefix: "uptime-kuma-v2-"
- name: "ghcr.io/bigboot/kuma"
dockerfile: Dockerfile.cli
build_args: "FEATURES=uptime-kuma-v2"
tag_prefix: "uptime-kuma-v2-"

steps:
- uses: actions/checkout@v4
Expand All @@ -37,6 +49,10 @@ jobs:
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
flavor: |
latest=auto
prefix=${{ matrix.tag_prefix }},onlatest=true
suffix=
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -56,7 +72,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ contains(github.ref, 'tags/') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
platforms: ${{ 'linux/amd64,linux/arm64' }}
file: ${{ matrix.dockerfile }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM rust:1.81 as builder
ARG FEATURES=

FROM rust:1.81 AS builder
ARG FEATURES
WORKDIR /usr/src/autokuma
COPY . .
RUN cargo install --path ./autokuma
RUN cargo install --features "${FEATURES}" --path ./autokuma

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile.cli
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM rust:1.81 as builder
ARG FEATURES=

FROM rust:1.81 AS builder
ARG FEATURES
WORKDIR /usr/src/autokuma
COPY . .
RUN cargo install --path ./kuma-cli
RUN cargo install --features "${FEATURES}" --path ./kuma-cli

FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
Expand Down
1 change: 1 addition & 0 deletions autokuma/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ required-features = ["kubernetes"]
default = ["kubernetes"]
kubernetes = ["dep:kube", "dep:k8s-openapi", "dep:schemars", "dep:serde_yaml"]
tokio-console = ["dep:console-subscriber", "tokio/tracing"]
uptime-kuma-v2 = ["kuma-client/uptime-kuma-v2"]

[dependencies]
kuma-client = { path = "../kuma-client", version = "0.0.0", features = [
Expand Down
3 changes: 3 additions & 0 deletions kuma-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ keywords = ["uptime-kuma", "api", "automation", "monitoring", "socketio"]
name = "kuma"
path = "src/main.rs"

[features]
uptime-kuma-v2 = ["kuma-client/uptime-kuma-v2"]

[dependencies]
kuma-client = { path = "../kuma-client", version = "0.0.0" }

Expand Down
1 change: 1 addition & 0 deletions kuma-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ keywords = ["uptime-kuma", "api", "monitoring"]

[features]
private-api = []
uptime-kuma-v2 = []

[dependencies]
config = { workspace = true }
Expand Down
Loading

0 comments on commit e2bb2d1

Please sign in to comment.