mirror of
https://github.com/kairos-io/immucore.git
synced 2025-08-16 21:27:28 +00:00
Update Earthfile
This commit is contained in:
parent
2d96a92f44
commit
afca5f83f9
20
Earthfile
20
Earthfile
@ -21,15 +21,14 @@ go-deps:
|
|||||||
ARG GO_VERSION
|
ARG GO_VERSION
|
||||||
FROM golang:$GO_VERSION
|
FROM golang:$GO_VERSION
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY go.mod go.sum ./
|
COPY . .
|
||||||
|
RUN go mod tidy --compat=1.19
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
SAVE ARTIFACT go.mod AS LOCAL go.mod
|
RUN go mod verify
|
||||||
SAVE ARTIFACT go.sum AS LOCAL go.sum
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
FROM +go-deps
|
FROM +go-deps
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY . .
|
|
||||||
RUN go run github.com/onsi/ginkgo/v2/ginkgo --race --covermode=atomic --coverprofile=coverage.out -p -r ./...
|
RUN go run github.com/onsi/ginkgo/v2/ginkgo --race --covermode=atomic --coverprofile=coverage.out -p -r ./...
|
||||||
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
|
SAVE ARTIFACT coverage.out AS LOCAL coverage.out
|
||||||
|
|
||||||
@ -37,24 +36,17 @@ golint:
|
|||||||
ARG GOLINT_VERSION
|
ARG GOLINT_VERSION
|
||||||
FROM golangci/golangci-lint:$GOLINT_VERSION
|
FROM golangci/golangci-lint:$GOLINT_VERSION
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY . .
|
|
||||||
RUN golangci-lint run -v
|
RUN golangci-lint run -v
|
||||||
|
|
||||||
build-immucore:
|
build-immucore:
|
||||||
FROM +go-deps
|
FROM +go-deps
|
||||||
WORKDIR /work
|
WORKDIR /build
|
||||||
COPY go.mod go.sum /work
|
|
||||||
COPY main.go /work
|
|
||||||
COPY --dir internal /work
|
|
||||||
COPY --dir pkg /work
|
|
||||||
COPY +version/VERSION ./
|
|
||||||
COPY +version/COMMIT ./
|
|
||||||
ARG VERSION=$(cat VERSION)
|
ARG VERSION=$(cat VERSION)
|
||||||
ARG COMMIT=$(cat COMMIT)
|
ARG COMMIT=$(cat COMMIT)
|
||||||
ARG LDFLAGS="-s -w -X github.com/kairos-io/immucore/internal/version.version=$VERSION -X github.com/kairos-io/immucore/internal/version.gitCommit=$COMMIT"
|
ARG LDFLAGS="-s -w -X github.com/kairos-io/immucore/internal/version.version=$VERSION -X github.com/kairos-io/immucore/internal/version.gitCommit=$COMMIT"
|
||||||
RUN echo ${LDFLAGS}
|
RUN echo ${LDFLAGS}
|
||||||
RUN CGO_ENABLED=0 go build -o immucore -ldflags "${LDFLAGS}"
|
RUN CGO_ENABLED=0 go build -o immucore -ldflags "${LDFLAGS}"
|
||||||
SAVE ARTIFACT /work/immucore immucore AS LOCAL build/immucore-$VERSION
|
SAVE ARTIFACT /build/immucore immucore AS LOCAL build/immucore-$VERSION
|
||||||
|
|
||||||
# Alias for ease of use
|
# Alias for ease of use
|
||||||
build:
|
build:
|
||||||
@ -66,4 +58,4 @@ dracut-artifacts:
|
|||||||
COPY --dir dracut/28immucore .
|
COPY --dir dracut/28immucore .
|
||||||
COPY dracut/10-immucore.conf .
|
COPY dracut/10-immucore.conf .
|
||||||
SAVE ARTIFACT 28immucore 28immucore
|
SAVE ARTIFACT 28immucore 28immucore
|
||||||
SAVE ARTIFACT 10-immucore.conf 10-immucore.conf
|
SAVE ARTIFACT 10-immucore.conf 10-immucore.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user