Skip to content

Commit

Permalink
Earthfile: fix builds for Anubis
Browse files Browse the repository at this point in the history
Signed-off-by: Xe Iaso <[email protected]>
  • Loading branch information
Xe committed Jan 22, 2025
1 parent fbb311e commit 04deb23
Showing 1 changed file with 17 additions and 21 deletions.
38 changes: 17 additions & 21 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ build:
RUN go mod download

COPY . .
RUN go build -o /app/bin/${PROGRAM} ./cmd/${PROGRAM}
ARG VERSION=$(git describe --tags --always --dirty)
RUN --mount=type=cache,target=/root/.cache go build -o /app/bin/${PROGRAM} -ldflags="-X within.website/x.Version=${VERSION}" ./cmd/${PROGRAM}

SAVE ARTIFACT bin

Expand All @@ -50,13 +51,8 @@ ship:
COPY --platform=${TARGETPLATFORM} (+runtime/ca-certificates.crt) /etc/ssl/certs/ca-certificates.crt
COPY --platform=${TARGETPLATFORM} (+build/bin/${PROGRAM} --GOARCH=${GOARCH} --PROGRAM=${PROGRAM}) /app/bin/${PROGRAM}

CMD ["/app/bin/${PROGRAM}"]
USER 1000:1000

LABEL org.opencontainers.image.source="https://github.com/Xe/x"

SAVE IMAGE --push ghcr.io/xe/x/${PROGRAM}:latest

everything:
FROM +deps

Expand All @@ -68,28 +64,28 @@ everything:
SAVE ARTIFACT bin

aerial:
FROM +runtime

COPY +everything/bin/aerial /app/bin/aerial
CMD ["/app/bin/aerial"]

LABEL org.opencontainers.image.source="https://github.com/Xe/x"

SAVE IMAGE --push ghcr.io/xe/x/aerial:latest
BUILD +ship --PROGRAM=aerial --GOARCH=amd64

amano:
FROM +runtime
BUILD +ship --PROGRAM=amano --GOARCH=amd64

COPY +everything/bin/amano /app/bin/amano
CMD ["/app/bin/amano"]
anubis-amd64:
FROM +ship --PROGRAM=anubis --GOARCH=amd64
CMD ["/app/bin/anubis"]
USER 1000:1000

LABEL org.opencontainers.image.source="https://github.com/Xe/x"
SAVE IMAGE --push ghcr.io/xe/x/anubis:latest

anubis-arm64:
FROM +ship --PROGRAM=anubis --GOARCH=arm64
CMD ["/app/bin/anubis"]
USER 1000:1000

SAVE IMAGE --push ghcr.io/xe/x/amano:latest
SAVE IMAGE --push ghcr.io/xe/x/anubis:latest

anubis:
BUILD +ship --PROGRAM=anubis --GOARCH=amd64
BUILD +ship --PROGRAM=anubis --GOARCH=arm64
BUILD +anubis-amd64
BUILD +anubis-arm64

aura:
FROM +runtime
Expand Down

0 comments on commit 04deb23

Please sign in to comment.