-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
34 lines (27 loc) · 924 Bytes
/
Makefile
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
PROJECT_ROOT := $(shell git rev-parse --show-toplevel)
GO_FILES := $(shell git ls-files '*.go' '*.sum')
IMAGE_FILES := $(shell find deploy)
ARCH ?= linux/amd64
SYSBOX_SHA ?= f02ffb48eae99d6c884c9aa0378070cc716d028f58e87deec5ae00a41b706fe8
.PHONY: clean
clean:
rm -rf build
build/envbox: $(GO_FILES)
CGO_ENABLED=0 go build -o build/envbox ./cmd/envbox
.PHONY: build/image/envbox
build/image/envbox: build/image/envbox/.ctx
build/image/envbox/.ctx: build/envbox $(IMAGE_FILES)
mkdir -p $(@D)
cp -r build/envbox deploy/. $(@D)
docker buildx build --build-arg SYSBOX_SHA=$(SYSBOX_SHA) -t envbox --platform $(ARCH) $(@D)
touch $@
.PHONY: fmt
fmt: fmt/go fmt/md
.PHONY: fmt/go
fmt/go:
# VS Code users should check out
# https://github.com/mvdan/gofumpt#visual-studio-code
go run mvdan.cc/[email protected] -w -l .
.PHONY: fmt/md
fmt/md:
go run github.com/Kunde21/markdownfmt/v3/cmd/[email protected] -w ./README.md