-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Makefile
46 lines (34 loc) · 1.02 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
.PHONY: ci deploy deps install lint serve
GITBOOK = $(shell command -v ./node_modules/.bin/gitbook 2> /dev/null)
MARKDOWNLINT = $(shell command -v ./node_modules/.bin/markdownlint 2> /dev/null)
YARN = $(shell command -v yarn 2> /dev/null)
# This is run on CI to verify linting is OK and that the guide builds
ci: lint
$(GITBOOK) install && $(GITBOOK) build
# Deploy new version of the guide. Will update list of contributors
deploy:
sh ./scripts/publish_gitbook.sh
# Install dependencies
deps:
ifeq ($(YARN),)
$(error "yarn is not available, please install it")
else
$(YARN)
endif
# Install dependencies and gitbook
install: deps
$(GITBOOK) install
# Lint markdown files
lint:
ifeq ($(MARKDOWNLINT),)
$(error "markdownlint is not installed, run 'make deps' to install it")
else
@$(MARKDOWNLINT) . --ignore node_modules && echo 'All good 👌'
endif
# Start a server that serves the guide locally
serve:
ifeq ($(GITBOOK),)
$(error "GitBook is not available, please run 'make install' first")
else
$(GITBOOK) serve
endif