-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
54 lines (39 loc) · 1.33 KB
/
Earthfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
VERSION 0.6
ARG GO_VERSION=1.23.3
FROM busybox
LABEL org.opencontainers.image.source = "https://github.com/$EARTHLY_GIT_PROJECT_NAME"
build:
FROM golang:${GO_VERSION}-alpine3.20
ENV CGO_ENABLED=0
WORKDIR /app
COPY go.mod go.sum .
RUN go mod download
COPY . .
RUN go build -o dataproduct-topics ./cmd/dataproduct-topics
SAVE ARTIFACT dataproduct-topics
ARG EARTHLY_GIT_PROJECT_NAME
ARG IMAGE=ghcr.io/$EARTHLY_GIT_PROJECT_NAME
SAVE IMAGE --push ${IMAGE}-cache:build
tests:
LOCALLY
RUN go test ./...
linkerd-await:
FROM docker.io/curlimages/curl:latest
ARG LINKERD_AWAIT_VERSION=v0.2.4
WORKDIR /tmp
RUN curl -sSLo /tmp/linkerd-await https://github.com/linkerd/linkerd-await/releases/download/release%2F${LINKERD_AWAIT_VERSION}/linkerd-await-${LINKERD_AWAIT_VERSION}-amd64 && \
chmod 755 /tmp/linkerd-await
SAVE ARTIFACT linkerd-await
docker:
FROM alpine:3.20
WORKDIR /app
COPY +linkerd-await/linkerd-await .
COPY +build/dataproduct-topics .
COPY start.sh .
ENTRYPOINT [ "/app/linkerd-await", "--shutdown", "--" ]
CMD ["/app/start.sh"]
ARG EARTHLY_GIT_SHORT_HASH
ARG IMAGE_TAG=$EARTHLY_GIT_SHORT_HASH
ARG EARTHLY_GIT_PROJECT_NAME
ARG IMAGE=$EARTHLY_GIT_PROJECT_NAME
SAVE IMAGE --push ${IMAGE}:${IMAGE_TAG} ${IMAGE}:latest