Compare commits
No commits in common. "main" and "1.2.1" have entirely different histories.
7 changed files with 44 additions and 75 deletions
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
|
@ -8,10 +8,6 @@ updates:
|
||||||
day: "friday"
|
day: "friday"
|
||||||
time: "09:00"
|
time: "09:00"
|
||||||
timezone: "Europe/Berlin"
|
timezone: "Europe/Berlin"
|
||||||
groups:
|
|
||||||
gomod:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
|
|
||||||
- package-ecosystem: "docker"
|
- package-ecosystem: "docker"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
|
@ -28,7 +24,3 @@ updates:
|
||||||
day: "friday"
|
day: "friday"
|
||||||
time: "09:00"
|
time: "09:00"
|
||||||
timezone: "Europe/Berlin"
|
timezone: "Europe/Berlin"
|
||||||
groups:
|
|
||||||
github-actions:
|
|
||||||
patterns:
|
|
||||||
- "*"
|
|
||||||
|
|
43
.github/workflows/integration.yaml
vendored
43
.github/workflows/integration.yaml
vendored
|
@ -4,22 +4,22 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request_target:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: "1.17.x"
|
go-version: '1.17.x'
|
||||||
|
|
||||||
- name: Cache Go Dependencies
|
- name: Cache Go Dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
|
@ -36,19 +36,19 @@ jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- test
|
- test
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: "1.17.x"
|
go-version: '1.17.x'
|
||||||
|
|
||||||
- name: Cache Go Dependencies
|
- name: Cache Go Dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
|
@ -62,24 +62,3 @@ jobs:
|
||||||
|
|
||||||
- name: Docker
|
- name: Docker
|
||||||
run: docker build .
|
run: docker build .
|
||||||
|
|
||||||
automerge:
|
|
||||||
name: Merge Automatically
|
|
||||||
needs: [test, build]
|
|
||||||
runs-on: ubuntu-20.04
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
pull-requests: write
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Obtain Access Token
|
|
||||||
id: acces_token
|
|
||||||
run: |
|
|
||||||
TOKEN="$(npx obtain-github-app-installation-access-token ci ${{ secrets.SYSTEMLI_APP_CREDENTIALS_TOKEN }})"
|
|
||||||
echo "token=$TOKEN" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Merge
|
|
||||||
uses: fastify/github-action-merge-dependabot@v3
|
|
||||||
with:
|
|
||||||
github-token: ${{ steps.acces_token.outputs.token }}
|
|
||||||
|
|
6
.github/workflows/quality.yaml
vendored
6
.github/workflows/quality.yaml
vendored
|
@ -4,13 +4,13 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
pull_request:
|
pull_request_target:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
golangci:
|
golangci:
|
||||||
name: GolangCI
|
name: GolangCI
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
- name: GolangCI
|
- name: GolangCI
|
||||||
uses: golangci/golangci-lint-action@v3
|
uses: golangci/golangci-lint-action@v3
|
||||||
|
|
14
.github/workflows/release.yaml
vendored
14
.github/workflows/release.yaml
vendored
|
@ -7,18 +7,18 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: "1.17.x"
|
go-version: '1.17.x'
|
||||||
|
|
||||||
- name: Cache Go Dependencies
|
- name: Cache Go Dependencies
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
|
@ -28,13 +28,13 @@ jobs:
|
||||||
${{ runner.os }}-go-
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v3.0.0
|
uses: docker/login-action@v2.0.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Build Releases
|
- name: Build Releases
|
||||||
uses: goreleaser/goreleaser-action@v5.0.0
|
uses: goreleaser/goreleaser-action@v3.0.0
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
|
|
36
Dockerfile
36
Dockerfile
|
@ -1,30 +1,28 @@
|
||||||
# syntax=docker/dockerfile:1
|
FROM alpine:3.16.2 as builder
|
||||||
|
|
||||||
# Build the application from source
|
WORKDIR /go/src/github.com/systemli/prometheus-jitsi-meet-exporter
|
||||||
FROM golang:1.21.4 AS build-stage
|
|
||||||
|
|
||||||
WORKDIR /app
|
ENV USER=appuser
|
||||||
|
ENV UID=10001
|
||||||
|
|
||||||
COPY go.mod go.sum ./
|
RUN adduser \
|
||||||
RUN go mod download
|
--disabled-password \
|
||||||
|
--gecos "" \
|
||||||
|
--home "/nonexistent" \
|
||||||
|
--shell "/sbin/nologin" \
|
||||||
|
--no-create-home \
|
||||||
|
--uid "${UID}" \
|
||||||
|
"${USER}"
|
||||||
|
|
||||||
COPY *.go ./
|
|
||||||
|
|
||||||
RUN CGO_ENABLED=0 GOOS=linux go build -o /prometheus-jitsi-meet-exporter
|
FROM scratch
|
||||||
|
|
||||||
# Run the tests in the container
|
COPY --from=builder /etc/passwd /etc/passwd
|
||||||
FROM build-stage AS run-test-stage
|
COPY --from=builder /etc/group /etc/group
|
||||||
RUN go test -v ./...
|
COPY prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
|
||||||
|
|
||||||
# Deploy the application binary into a lean image
|
USER appuser:appuser
|
||||||
FROM gcr.io/distroless/base-debian11 AS build-release-stage
|
|
||||||
|
|
||||||
WORKDIR /
|
|
||||||
|
|
||||||
COPY --from=build-stage /prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
|
|
||||||
|
|
||||||
EXPOSE 9888
|
EXPOSE 9888
|
||||||
|
|
||||||
USER nonroot:nonroot
|
|
||||||
|
|
||||||
ENTRYPOINT ["/prometheus-jitsi-meet-exporter"]
|
ENTRYPOINT ["/prometheus-jitsi-meet-exporter"]
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -2,4 +2,4 @@ module github.com/systemli/prometheus-jitsi-meet-exporter
|
||||||
|
|
||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require github.com/google/go-cmp v0.6.0
|
require github.com/google/go-cmp v0.5.8
|
||||||
|
|
4
go.sum
4
go.sum
|
@ -1,2 +1,2 @@
|
||||||
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
|
||||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
|
|
Loading…
Add table
Reference in a new issue