forked from Kong/docs.konghq.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (36 loc) · 1.07 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
RUBY_VERSION := "$(shell ruby -v)"
RUBY_VERSION_REQUIRED := "$(shell cat .ruby-version)"
RUBY_MATCH := $(shell [[ "$(shell ruby -v)" =~ "ruby $(shell cat .ruby-version)" ]] && echo matched)
.PHONY: ruby-version-check
ruby-version-check:
ifndef RUBY_MATCH
@printf "ruby $(RUBY_VERSION_REQUIRED) is required. Found %s\n" $(RUBY_VERSION)
endif
install-prerequisites:
npm install -g gulp netlify-cli
# Installs npm packages and gems.
install: ruby-version-check
npm ci
bundle install
git submodule update --init
# Using local dependencies, starts a doc site instance on http://localhost:3000.
run: ruby-version-check
./node_modules/.bin/gulp
build: ruby-version-check
./node_modules/.bin/gulp build
# Cleans up all temp files in the build.
# Run `make clean` locally whenever you're updating dependencies, or to help
# troubleshoot build issues.
clean:
-rm -rf dist
-rm -rf app/.jekyll-cache
-rm app/.jekyll-metadata
# Runs tests
test:
npm test
smoke:
@netlify dev & echo $$! > netlify.PID
@sleep 3
@npm run test:smoke || true
@kill -TERM $$(cat netlify.PID)
@rm netlify.PID