forked from moby/buildkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
122 lines (94 loc) · 2.37 KB
/
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
prefix=/usr/local
bindir=$(prefix)/bin
ifneq (, $(BUILDX_BIN))
export BUILDX_CMD = $(BUILDX_BIN)
else ifneq (, $(shell docker buildx version))
export BUILDX_CMD = docker buildx
else ifneq (, $(shell command -v buildx))
export BUILDX_CMD = $(command -v buildx)
endif
export BUILDX_CMD ?= docker buildx
.PHONY: binaries
binaries:
$(BUILDX_CMD) bake binaries
.PHONY: cross
cross:
$(BUILDX_CMD) bake binaries-cross
.PHONY: images
images:
# moby/buildkit:local and moby/buildkit:local-rootless are created on Docker
hack/images local moby/buildkit
TARGET=rootless hack/images local moby/buildkit
.PHONY: install
install:
mkdir -p $(DESTDIR)$(bindir)
install bin/build/* $(DESTDIR)$(bindir)
.PHONY: release
release:
./hack/release
.PHONY: clean
clean:
rm -rf ./bin
.PHONY: test
test:
./hack/test integration gateway dockerfile
.PHONY: test-race
test-race:
CGO_ENABLED=1 GOBUILDFLAGS="-race" ./hack/test integration gateway dockerfile
.PHONY: lint
lint:
$(BUILDX_CMD) bake lint
.PHONY: validate-vendor
validate-vendor:
$(BUILDX_CMD) bake validate-vendor
.PHONY: validate-shfmt
validate-shfmt:
$(BUILDX_CMD) bake validate-shfmt
.PHONY: shfmt
shfmt:
$(BUILDX_CMD) bake shfmt
.PHONY: validate-authors
validate-authors:
$(BUILDX_CMD) bake validate-authors
.PHONY: validate-generated-files
validate-generated-files:
$(BUILDX_CMD) bake validate-generated-files
.PHONY: validate-archutil
validate-archutil:
$(BUILDX_CMD) bake validate-archutil
.PHONY: validate-doctoc
validate-doctoc:
$(BUILDX_CMD) bake validate-doctoc
.PHONY: validate-docs
validate-docs:
$(BUILDX_CMD) bake validate-docs
.PHONY: validate-all
validate-all: test lint validate-vendor validate-generated-files validate-archutil validate-doctoc validate-docs
.PHONY: vendor
vendor:
$(eval $@_TMP_OUT := $(shell mktemp -d -t buildkit-output.XXXXXXXXXX))
$(BUILDX_CMD) bake --set "*.output=type=local,dest=$($@_TMP_OUT)" vendor
rm -rf ./vendor
cp -R "$($@_TMP_OUT)"/out/* .
rm -rf "$($@_TMP_OUT)"/
.PHONY: generated-files
generated-files:
$(BUILDX_CMD) bake generated-files
.PHONY: archutil
archutil:
$(BUILDX_CMD) bake archutil
.PHONY: authors
authors:
$(BUILDX_CMD) bake authors
.PHONY: doctoc
doctoc:
$(BUILDX_CMD) bake doctoc
.PHONY: docs
docs:
$(BUILDX_CMD) bake docs
.PHONY: docs-dockerfile
docs-dockerfile:
$(BUILDX_CMD) bake docs-dockerfile
.PHONY: mod-outdated
mod-outdated:
$(BUILDX_CMD) bake mod-outdated