Compare commits

..

No commits in common. "main" and "1.2.0" have entirely different histories.
main ... 1.2.0

7 changed files with 46 additions and 75 deletions

View file

@ -8,10 +8,6 @@ updates:
day: "friday"
time: "09:00"
timezone: "Europe/Berlin"
groups:
gomod:
patterns:
- "*"
- package-ecosystem: "docker"
directory: "/"
@ -28,7 +24,3 @@ updates:
day: "friday"
time: "09:00"
timezone: "Europe/Berlin"
groups:
github-actions:
patterns:
- "*"

View file

@ -4,22 +4,22 @@ on:
push:
branches:
- main
pull_request:
pull_request_target:
jobs:
test:
name: Test
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@v3
with:
go-version: "1.17.x"
go-version: '1.17.x'
- name: Cache Go Dependencies
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
@ -36,19 +36,19 @@ jobs:
build:
name: Build
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
needs:
- test
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@v3
with:
go-version: "1.17.x"
go-version: '1.17.x'
- name: Cache Go Dependencies
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
@ -62,24 +62,3 @@ jobs:
- name: Docker
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 }}

View file

@ -4,13 +4,13 @@ on:
push:
branches:
- main
pull_request:
pull_request_target:
jobs:
golangci:
name: GolangCI
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: GolangCI
uses: golangci/golangci-lint-action@v3

View file

@ -7,18 +7,18 @@ on:
jobs:
release:
name: Release
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@v3
with:
go-version: "1.17.x"
go-version: '1.17.x'
- name: Cache Go Dependencies
uses: actions/cache@v4
uses: actions/cache@v2
with:
path: |
~/.cache/go-build
@ -28,13 +28,13 @@ jobs:
${{ runner.os }}-go-
- name: Login to Docker Hub
uses: docker/login-action@v3.0.0
uses: docker/login-action@v1.14.1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Releases
uses: goreleaser/goreleaser-action@v5.0.0
uses: goreleaser/goreleaser-action@v2.9.1
with:
version: latest
args: release --rm-dist

View file

@ -1,30 +1,28 @@
# syntax=docker/dockerfile:1
# Build the application from source
FROM golang:1.21.4 AS build-stage
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
RUN CGO_ENABLED=0 GOOS=linux go build -o /prometheus-jitsi-meet-exporter
FROM alpine:3.15.0 as builder
# Run the tests in the container
FROM build-stage AS run-test-stage
RUN go test -v ./...
WORKDIR /go/src/github.com/systemli/prometheus-jitsi-meet-exporter
# Deploy the application binary into a lean image
FROM gcr.io/distroless/base-debian11 AS build-release-stage
ENV USER=appuser
ENV UID=10001
WORKDIR /
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}"
COPY --from=build-stage /prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
FROM scratch
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
COPY prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
USER appuser:appuser
EXPOSE 9888
USER nonroot:nonroot
ENTRYPOINT ["/prometheus-jitsi-meet-exporter"]

2
go.mod
View file

@ -2,4 +2,4 @@ module github.com/systemli/prometheus-jitsi-meet-exporter
go 1.17
require github.com/google/go-cmp v0.6.0
require github.com/google/go-cmp v0.5.7

6
go.sum
View file

@ -1,2 +1,4 @@
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o=
github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE=
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=