Skip to content

Commit

Permalink
feat: add YAGPDB
Browse files Browse the repository at this point in the history
  • Loading branch information
JJGadgets committed Feb 1, 2024
1 parent 9c95d9c commit 84c7284
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
32 changes: 32 additions & 0 deletions apps/yagpdb/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Define build-time variables
ARG VERSION

# Stage 1: Build (pulled from upstream Dockerfile https://github.com/botlabs-gg/yagpdb/blob/7e6d553bd203680a0a1d68afd94f815478538611/yagpdb_docker/Dockerfile)
FROM docker.io/library/golang:1.21.6-bookworm AS builder
ARG VERSION

ADD https://github.com/botlabs-gg/yagpdb/archive/refs/tags/v${VERSION}.tar.gz /source.tar.gz
RUN tar -C /go/src -xvf /source.tar.gz
RUN rm /source.tar.gz

WORKDIR /go/src/yagpdb-${VERSION}
ENV GOPATH /go

RUN go mod download && go mod verify
WORKDIR /go/src/yagpdb-${VERSION}/cmd/yagpdb
RUN CGO_ENABLED=0 GOOS=linux go build -o /yagpdb -v -ldflags="-X github.com/botlabs-gg/yagpdb/v2/common.VERSION=v${VERSION}"

# Stage 2: Working app image
#FROM gcr.io/distroless/cc-debian12:nonroot@sha256:6cf8f0fafa8b4b911eefa9be9e2fe40fcf380f56de25d203dd9a3782c255d1f3
FROM gcr.io/distroless/static-debian12:nonroot@sha256:39ae7f0201fee13b777a3e4a5a9326a8889269172c8b4f4289d9f19c831f45f4
ARG VERSION
WORKDIR /app

ADD --chmod=555 --chown=1000:1000 --checksum=sha256:af8a43230338de67563878a25872ee2fd3d6af0f3513d55dd1ec672ad69dae53 https://github.com/openSUSE/catatonit/releases/download/v0.2.0/catatonit.x86_64 /catatonit
COPY --from=builder /yagpdb /app/yagpdb

USER 1000:1000
EXPOSE 8080/tcp
VOLUME ["/app/soundboard"]
ENTRYPOINT ["/catatonit", "--", "/app/yagpdb"]

6 changes: 6 additions & 0 deletions apps/yagpdb/ci/goss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
# https://github.com/aelsabbahy/goss/blob/master/docs/manual.md#port
port:
# https://github.com/aelsabbahy/goss/issues/149
tcp6:8080:
listening: true
9 changes: 9 additions & 0 deletions apps/yagpdb/ci/latest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
channel=$1

if [[ "${channel}" == "stable" ]]; then
version="$(curl -sX GET "https://api.github.com/repos/botlabs-gg/yagpdb/releases/latest" | jq --raw-output '.tag_name' 2>/dev/null)"
fi
version="${version#*v}"
version="${version#*release-}"
printf "%s" "${version}"
16 changes: 16 additions & 0 deletions apps/yagpdb/metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
app: yagpdb
base: false
channels:
- &c
name: stable
platforms:
- "linux/amd64"
#- "linux/arm64"
stable: true
tests:
enabled: false # TODO: pass env vars and/or args to `dgoss run` tests: "invalid config: host must be set"
# type: web
#- <<: *c
# name: master
# stable: false

0 comments on commit 84c7284

Please sign in to comment.