latest with caching
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing

This commit is contained in:
Jeffrey Paul 2022-12-09 01:40:33 +04:00
parent 587f9420ea
commit 9e36462a38
7 changed files with 26 additions and 17 deletions

View File

@ -1,6 +1,2 @@
*.tzst
/buildimage
/dockerdeps
/tmp
*.docker.tzst
*.tmp
*.dockerimage

4
.gitignore vendored
View File

@ -2,7 +2,5 @@ mfer/*.pb.go
/mfer.cmd
/tmp
*.tmp
*.docker.tzst
*.tzst
/builddeps/modcache.tar
*.dockerimage
/vendor

View File

@ -1,23 +1,29 @@
################################################################################
#2345678911234567892123456789312345678941234567895123456789612345678971234567898
################################################################################
FROM sneak/builder:14e59af AS builder
FROM sneak/builder:2022-12-08 AS builder
ENV DEBIAN_FRONTEND noninteractive
WORKDIR /build
COPY ./Makefile ./.golangci.yml ./go.mod ./go.sum .
COPY ./vendor.tar /build/vendor.tar
COPY ./vendor.tzst /build/vendor.tzst
COPY ./modcache.tzst /build/modcache.tzst
COPY ./internal ./internal
COPY ./bin/gitrev.sh ./bin/gitrev.sh
COPY ./mfer ./mfer
COPY ./cmd ./cmd
RUN find /build
ARG GITREV unknown
RUN mkdir -p "$(go env GOMODCACHE)" && cd "$(go env GOMODCACHE)" && \
zstdmt -d --stdout /build/modcache.tzst | tar xf - && \
rm /build/modcache.tzst && cd /build
RUN \
cd mfer && go generate . && cd .. && \
GOPACKAGESDEBUG=true golangci-lint run ./... && \
tar xf vendor.tar && rm vendor.tar && \
mkdir vendor && cd vendor && \
zstdmt -d --stdout /build/vendor.tzst | tar xf - && rm /build/vendor.tzst && \
cd .. && \
make mfer.cmd
RUN go mod vendor && tar -c . | zstdmt -19 > /src.tzst
RUN rm -rf /build/vendor && go mod vendor && tar -c . | zstdmt -19 > /src.tzst
################################################################################
#2345678911234567892123456789312345678941234567895123456789612345678971234567898
################################################################################

View File

@ -56,9 +56,9 @@ lint:
golangci-lint run
sh -c 'test -z "$$(gofmt -l .)"'
docker: sneak-mfer.$(ARCH).docker.tzst
docker: sneak-mfer.$(ARCH).tzst.dockerimage
sneak-mfer.$(ARCH).docker.tzst: $(SOURCEFILES) vendor.tar
sneak-mfer.$(ARCH).tzst.dockerimage: $(SOURCEFILES) vendor.tzst modcache.tzst
docker build --progress plain --build-arg GITREV=$(GITREV_BUILD) -t sneak/mfer .
docker save sneak/mfer | pv | zstdmt -19 > $@
du -sh $@
@ -67,7 +67,16 @@ godoc:
open http://127.0.0.1:6060
godoc -http=:6060
vendor.tar: go.mod go.sum
vendor.tzst: go.mod go.sum
go mod tidy
go mod vendor
tar -c vendor > $@
cd vendor && tar -c . | pv | zstdmt -19 > $(PWD)/$@.tmp
rm -rf vendor
mv $@.tmp $@
modcache.tzst: go.mod go.sum
go mod tidy
cd $(HOME)/go/pkg && chmod -R u+rw . && rm -rf mod sumdb
go mod download -x
cd $(shell go env GOMODCACHE) && tar -c . | pv | zstdmt -19 > $(PWD)/$@.tmp
mv $@.tmp $@

BIN
modcache.tzst Normal file

Binary file not shown.

Binary file not shown.

BIN
vendor.tzst Normal file

Binary file not shown.