forked from acorn-io/runtime
/
Makefile
57 lines (44 loc) · 1.52 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
build:
CGO_ENABLED=0 go build -o bin/acorn -ldflags "-s -w" .
download-latest-ui:
curl -sL https://cdn.acrn.io/ui/latest.tar.gz | tar xzf - -C pkg/ui/server/static/dashboard --strip-components=1
download-ui:
curl -sL https://cdn.acrn.io/ui/latest.tar.gz | tar xzf - -C pkg/ui/server/static/dashboard --strip-components=1
generate:
go generate
image:
docker build .
validate:
golangci-lint --timeout 5m run
validate-ci:
go generate
go mod tidy
go run tools/gendocs/main.go
if [ -n "$$(git status --porcelain)" ]; then \
git status --porcelain; \
echo "Encountered dirty repo!"; \
exit 1 \
;fi
test:
go test ./...
goreleaser:
goreleaser build --snapshot --single-target --rm-dist
setup-ci-env:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $$(go env GOPATH)/bin v1.46.2
# This will initialize the node_modules needed to run the docs dev server. Run this before running serve-docs
init-docs:
docker run --rm --workdir=/docs -v $${PWD}/docs:/docs node:18-buster yarn install
# Ensure docs build without errors. Makes sure generated docs are in-sync with CLI.
validate-docs:
docker run --rm --workdir=/docs -v $${PWD}/docs:/docs node:18-buster yarn build
go run tools/gendocs/main.go
if [ -n "$$(git status --porcelain --untracked-files=no)" ]; then \
git status --porcelain --untracked-files=no; \
echo "Encountered dirty repo!"; \
exit 1 \
;fi
# Launch development server for the docs site
serve-docs:
acorn run -i ./docs
gen-docs:
go run tools/gendocs/main.go