forked from endocrimes/buildkite-gcp-scaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Earthfile
41 lines (34 loc) · 1.09 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
VERSION 0.7
FROM us.gcr.io/bluecore-ops/dockerfiles/golang:lint-1.19
WORKDIR /app
ENV GOPRIVATE=github.com/TriggerMail
ci:
BUILD +tests
BUILD +docker
BUILD +lint
go-mod:
RUN git config --global url."[email protected]:".insteadOf "https://github.com/"
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
COPY go.mod go.sum .
RUN --ssh go mod download
vendor:
FROM +go-mod
COPY --dir pkg scaler main.go /app
RUN --ssh go mod vendor
SAVE ARTIFACT . /files
tests:
FROM +vendor
RUN go test -v ./... -cover
lint:
FROM +vendor
RUN go fmt ./...
build:
FROM +vendor
RUN go build -mod=vendor -o bin/buildkite-gcp-autoscaler main.go
SAVE ARTIFACT ./bin/buildkite-gcp-autoscaler /buildkite-gcp-autoscaler
docker:
FROM us.gcr.io/bluecore-ops/dockerfiles/golang:lint-1.19
ARG EARTHLY_GIT_SHORT_HASH
COPY +build/buildkite-gcp-autoscaler /buildkite-gcp-autoscaler
ENTRYPOINT ["/buildkite-gcp-autoscaler"]
SAVE IMAGE --push us-central1-docker.pkg.dev/bluecore-ops/ops/buildkite-gcp-autoscaler:${EARTHLY_GIT_SHORT_HASH}