forked from coder/envbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
32 lines (25 loc) · 762 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
PROJECT_ROOT := $(shell git rev-parse --show-toplevel)
GO_FILES := $(shell git ls-files '*.go' '*.sum')
IMAGE_FILES := $(shell find deploy)
.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 build -t envbox $(@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/gofumpt@v0.4.0 -w -l .
.PHONY: fmt/md
fmt/md:
go run github.com/Kunde21/markdownfmt/v3/cmd/markdownfmt@v3.1.0 -w ./README.md