-
Notifications
You must be signed in to change notification settings - Fork 268
/
Makefile
189 lines (142 loc) · 5.5 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
.PHONY: default
default: in-docker-build ## Build using docker environment (default target)
@echo "Run make help for info about other make targets"
.PHONY: ci
ci: in-docker-.ci ## Run CI locally
.PHONY: ci-shell
ci-shell: clean .dapper ## Launch a shell in the CI environment to troubleshoot. Runs clean first
@echo
@echo '######################################################'
@echo '# Run "make dapper-ci" to reproduce CI in this shell #'
@echo '######################################################'
@echo
./.dapper -f Dockerfile --target dapper -s
.PHONY: dapper-ci
dapper-ci: .ci ## Used by Drone CI, does the same as "ci" but in a Drone way
.ci: validate validate-charts build package
.PHONY: build
build: ## Build using host go tools
./scripts/build
.PHONY: build-binary
build-binary: ## Build only the Linux binary using host go tools
./scripts/build-binary
.PHONY: build-windows-binary
build-windows-binary: ## Build only the Windows binary using host go tools
./scripts/build-windows-binary
.PHONY: build-debug
build-debug: ## Debug build using host go tools
GODEBUG=y ./scripts/build-binary
.PHONY: scan-images
scan-images:
./scripts/scan-images
.PHONY: build-images
build-images: ## Build all images and image tarballs (including airgap)
./scripts/build-images
.PHONY: build-windows-images
build-windows-images: ## Build only the Windows images and tarballs (including airgap)
./scripts/build-windows-images
.PHONY: build-image-runtime
build-image-runtime: ## Build the runtime image
./scripts/build-image-runtime
.PHONY: publish-image-runtime
publish-image-runtime:
./scripts/publish-image-runtime
.PHONY: publish-image-runtime-windows
publish-image-runtime-windows:
./scripts/publish-image-runtime-windows
.PHONY: validate
validate: ## Run go fmt/vet
./scripts/validate
.PHONY: validate-release
validate-release:
./scripts/validate-release
.PHONY: validate-charts
validate-charts:
./scripts/validate-charts
.PHONY: run
run: build-debug
./scripts/run
.PHONY: remote-debug
remote-debug: build-debug ## Run with remote debugging listening on :2345
./scripts/remote-debug
.PHONY: remote-debug-exit
remote-debug-exit: ## Kill dlv started with make remote-debug
./scripts/remote-debug-exit
.PHONY: dev-shell-build
dev-shell-build: in-docker-build
./scripts/dev-shell-build
.PHONY: clean-cache
clean-cache: ## Clean up docker base caches used for development
./scripts/clean-cache
.PHONY: clean
clean: ## Clean up workspace
./scripts/clean
.PHONY: dev-shell
dev-shell: dev-shell-build ## Launch a development shell to run test builds
./scripts/dev-shell
.PHONY: dev-shell-enter
dev-shell-enter: ## Enter the development shell on another terminal
./scripts/dev-shell-enter
.PHONY: dev-peer
dev-peer: dev-shell-build ## Launch a server peer to run test builds
./scripts/dev-peer
.PHONY: dev-peer-enter
dev-peer-enter: ## Enter the peer shell on another terminal
./scripts/dev-peer-enter
.PHONY: publish-manifest-kubernetes
publish-manifest-kubernetes: build-image-kubernetes ## Create and push the kubernetes manifest
./scripts/publish-manifest-kubernetes
.PHONY: publish-manifest-runtime
publish-manifest-runtime: ## Create and push the runtime manifest
./scripts/publish-manifest-runtime
.PHONY: publish-binary
publish-binary: ## Upload binaries
./scripts/publish-binary
.PHONY: dispatch
dispatch: ## Send dispatch event to rke2-upgrade repo
./scripts/dispatch
.PHONY: package
package: build ## Package the rke2 binary
./scripts/package
.PHONY: package-images
package-images: build-images ## Package docker images for airgap environment
./scripts/package-images
.PHONY: package-windows-images
package-windows-images: build-windows-images ## Package Windows crane images for airgap environment
./scripts/package-windows-images
.PHONY: package-image-runtime
package-image-runtime: build-image-runtime ## Package runtime image for GH Actions testing
./scripts/package-image-runtime
.PHONY: package-bundle
package-bundle: build-binary ## Package the tarball bundle
./scripts/package-bundle
.PHONY: package-windows-bundle
package-windows-bundle: build-windows-binary ## Package the Windows tarball bundle
./scripts/package-windows-bundle
.PHONY: test
test: test-unit test-docker
.PHONY: test-unit
unit-test:
./scripts/test-unit
.PHONY: test-docker
test-docker:
./scripts/test
.PHONY: checksum
checksum:
./scripts/checksum
./.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/v0.5.8/dapper-$$(uname -s)-$$(uname -m) > .dapper.tmp
@@chmod +x .dapper.tmp
@./.dapper.tmp -v
@mv .dapper.tmp .dapper
in-docker-%: .dapper ## Advanced: wraps any target in Docker environment, for example: in-docker-build-debug
mkdir -p ./bin/ ./dist/ ./build
./.dapper -f Dockerfile --target dapper make $*
.PHONY: help
help: ## this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
serve-docs: mkdocs
docker run -p 8000:8000 --rm -it -v $${PWD}:/docs mkdocs serve -a 0.0.0.0:8000
mkdocs:
docker build -t mkdocs -f Dockerfile.docs .