Compare commits
56 commits
Author | SHA1 | Date | |
---|---|---|---|
62484b3681 | |||
|
771354726b | ||
c9f1f3450d | |||
|
8680f7e544 | ||
|
ecdadc8f0b | ||
|
7a943cd22e | ||
|
004b344a2b | ||
|
e40b9d53f0 | ||
|
52eb8cb6d5 | ||
|
b43e349762 | ||
|
7d0aeeeb31 | ||
|
65668bafe4 | ||
|
62a02a15e3 | ||
|
a497060165 | ||
|
f3c6e172db | ||
|
70d7e3c7bb | ||
|
3a7c6471d6 | ||
|
80e5f8105d | ||
|
a691c21aef | ||
|
5d0795a756 | ||
|
d04c58bbd9 | ||
|
eaaf297b5b | ||
|
2d36af767b | ||
|
7e020599ed | ||
|
655529c81e | ||
|
80dda190de | ||
|
1097e3475f | ||
|
ff981b1e15 | ||
|
723db8f3d2 | ||
|
12685d0ff6 | ||
|
26ade08c6b | ||
|
7087f54292 | ||
|
44806fb292 | ||
|
7c000e96dc | ||
|
a7760b7a80 | ||
|
a8c700031e | ||
|
d1ea6f21f4 | ||
|
3a6b600093 | ||
|
ac11731246 | ||
|
38bc554eb1 | ||
|
bd1431a803 | ||
|
fed924c0e0 | ||
|
ceaa305c21 | ||
|
cfd15d10c3 | ||
|
1c29be8190 | ||
|
13d2a695a8 | ||
|
857f59ee60 | ||
|
cd433aaf88 | ||
|
c8e341cfab | ||
|
07c2f1d5bb | ||
|
b9befd7943 | ||
|
86d8462564 | ||
|
68cf47789a | ||
|
29bac04d1f | ||
|
610dbc373d | ||
|
8d05cb72a4 |
7 changed files with 75 additions and 46 deletions
8
.github/dependabot.yml
vendored
8
.github/dependabot.yml
vendored
|
@ -8,6 +8,10 @@ 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: "/"
|
||||||
|
@ -24,3 +28,7 @@ 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_target:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.17.x'
|
go-version: "1.17.x"
|
||||||
|
|
||||||
- name: Cache Go Dependencies
|
- name: Cache Go Dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
|
@ -36,19 +36,19 @@ jobs:
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
needs:
|
needs:
|
||||||
- test
|
- test
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.17.x'
|
go-version: "1.17.x"
|
||||||
|
|
||||||
- name: Cache Go Dependencies
|
- name: Cache Go Dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cache/go-build
|
~/.cache/go-build
|
||||||
|
@ -62,3 +62,24 @@ 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_target:
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
golangci:
|
golangci:
|
||||||
name: GolangCI
|
name: GolangCI
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
- 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-latest
|
runs-on: ubuntu-20.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup go
|
- name: Setup go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.17.x'
|
go-version: "1.17.x"
|
||||||
|
|
||||||
- name: Cache Go Dependencies
|
- name: Cache Go Dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
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@v1.14.1
|
uses: docker/login-action@v3.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@v2.9.1
|
uses: goreleaser/goreleaser-action@v5.0.0
|
||||||
with:
|
with:
|
||||||
version: latest
|
version: latest
|
||||||
args: release --rm-dist
|
args: release --rm-dist
|
||||||
|
|
36
Dockerfile
36
Dockerfile
|
@ -1,28 +1,30 @@
|
||||||
FROM alpine:3.15.0 as builder
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/systemli/prometheus-jitsi-meet-exporter
|
# Build the application from source
|
||||||
|
FROM golang:1.21.4 AS build-stage
|
||||||
|
|
||||||
ENV USER=appuser
|
WORKDIR /app
|
||||||
ENV UID=10001
|
|
||||||
|
|
||||||
RUN adduser \
|
COPY go.mod go.sum ./
|
||||||
--disabled-password \
|
RUN go mod download
|
||||||
--gecos "" \
|
|
||||||
--home "/nonexistent" \
|
|
||||||
--shell "/sbin/nologin" \
|
|
||||||
--no-create-home \
|
|
||||||
--uid "${UID}" \
|
|
||||||
"${USER}"
|
|
||||||
|
|
||||||
|
COPY *.go ./
|
||||||
|
|
||||||
FROM scratch
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /prometheus-jitsi-meet-exporter
|
||||||
|
|
||||||
COPY --from=builder /etc/passwd /etc/passwd
|
# Run the tests in the container
|
||||||
COPY --from=builder /etc/group /etc/group
|
FROM build-stage AS run-test-stage
|
||||||
COPY prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
|
RUN go test -v ./...
|
||||||
|
|
||||||
USER appuser:appuser
|
# Deploy the application binary into a lean image
|
||||||
|
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.5.7
|
require github.com/google/go-cmp v0.6.0
|
||||||
|
|
6
go.sum
6
go.sum
|
@ -1,4 +1,2 @@
|
||||||
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
|
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
|
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue