-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (36 loc) · 803 Bytes
/
Makefile
File metadata and controls
49 lines (36 loc) · 803 Bytes
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
DOCKER := $(if $(LRN_SDK_NO_DOCKER),,$(shell which docker))
NODE_VERSION = 24
TARGETS = build test clean test-unit install-deps audit-deps lint lint-fix generate-types
.PHONY: $(TARGETS)
ifneq (,$(DOCKER))
# Re-run the make command in a container
DKR = docker container run -t --rm \
-v $(CURDIR):/srv/sdk/node \
-v lrn-sdk-node_cache:/root/.cache \
-w /srv/sdk/node \
-e LRN_SDK_NO_DOCKER=1 \
-e ENV -e REGION -e VER \
node:$(NODE_VERSION)
$(TARGETS):
$(DKR) make -e MAKEFLAGS="$(MAKEFLAGS)" $@
else
ENV = prod
REGION = .learnosity.com
VER = v1
build: install-deps lint
test: build test-unit
clean:
-rm -rf node_modules
test-unit:
npm test
install-deps:
npm install
audit-deps:
npm audit
lint:
npm run lint
lint-fix:
npm run lint -- --fix
generate-types:
npx tsc
endif