-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
43 lines (37 loc) · 1.01 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
VERSION 0.7
FROM golang:1.22-bookworm
WORKDIR /workspace
docker-all:
BUILD --platform=linux/amd64 --platform=linux/arm64 +docker
docker:
FROM quay.io/ceph/ceph:v18.2
ARG TARGETARCH
RUN yum install -y qemu-img
COPY (+build/picoceph --GOARCH=${TARGETARCH}) /usr/bin/picoceph
EXPOSE 7480/tcp # S3 API
EXPOSE 8080/tcp # Dashboard
ENTRYPOINT ["picoceph"]
ARG VERSION=latest-dev
SAVE IMAGE --push ghcr.io/dpeckett/picoceph:${VERSION}
SAVE IMAGE --push ghcr.io/dpeckett/picoceph:latest
build:
ARG GOOS=linux
ARG GOARCH=amd64
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build --ldflags '-s' -o picoceph cmd/main.go
SAVE ARTIFACT ./picoceph AS LOCAL dist/picoceph-${GOOS}-${GOARCH}
tidy:
LOCALLY
RUN go mod tidy
RUN go fmt ./...
lint:
FROM golangci/golangci-lint:v1.57.2
WORKDIR /workspace
COPY . ./
RUN golangci-lint run --timeout 5m ./...
test:
COPY . ./
RUN go test -coverprofile=coverage.out -v ./...
SAVE ARTIFACT ./coverage.out AS LOCAL coverage.out