Skip to content

Commit

Permalink
feat: add csp-exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgon committed Dec 2, 2023
1 parent 7be63a7 commit 39715fc
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
29 changes: 29 additions & 0 deletions apps/csp-exporter/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
ARG VERSION
FROM public.ecr.aws/docker/library/golang:1.21-alpine as builder

ARG TARGETPLATFORM
ARG VERSION
ARG CHANNEL

WORKDIR /app

#hadolint ignore=DL3018
RUN apk add --no-cache --update bash git \
&& git clone --branch "v${VERSION}" https://git.benburwell.com/csp_exporter . \
&& bash -c 'IFS=/ read -r GOOS GOARCH <<< "${TARGETPLATFORM}" && go build -o csp_exporter main.go'

FROM ghcr.io/dexters-ops/alpine:3.18.5

ENV COLLECTOR_BIND_ADDR=0.0.0.0:8000
ENV PROM_BIND_ADDR=0.0.0.0:9477

COPY --from=builder /app/csp_exporter /usr/bin/csp_exporter

USER 65000:65000

EXPOSE 3000
VOLUME ["/tmp"]
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/base-entrypoint.sh"]
CMD ["csp_exporter"]

LABEL org.opencontainers.image.source="https://git.benburwell.com/csp_exporter"
34 changes: 34 additions & 0 deletions apps/csp-exporter/ci/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
# https://github.com/goss-org/goss/blob/master/docs/manual.md#group
group:
abc:
exists: true
gid: 65000
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#file
file:
/usr/bin/csp_exporter:
exists: true
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#http
http:
http://localhost:9477/metrics:
status: 200
timeout: 1000
http://localhost:8000/report/csp/test:
status: 400
timeout: 1000
# https://github.com/goss-org/goss/blob/master/docs/manual.md#mount
mount:
/tmp:
exists: true
# https://github.com/goss-org/goss/blob/master/docs/manual.md#port
port:
tcp6:8000:
listening: true
tcp6:9477:
listening: true
# https://github.com/goss-org/goss/blob/master/docs/manual.md#user
user:
abc:
exists: true
uid: 65000
gid: 65000
18 changes: 18 additions & 0 deletions apps/csp-exporter/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"app": "csp-exporter",
"base": false,
"testMuteCmd": false,
"channels": [
{
"name": "stable",
"renovate::dataSource": "git-tags",
"renovate::depName": "https://git.benburwell.com/csp_exporter",
"version": "0.1.0",
"platforms": [
"linux/amd64",
"linux/arm64"
]
}
]
}

0 comments on commit 39715fc

Please sign in to comment.