-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (44 loc) · 1.37 KB
/
Makefile
File metadata and controls
55 lines (44 loc) · 1.37 KB
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
COMMIT_SHA := $(shell git rev-parse --short HEAD)
DEPLOY_SITE := omdb-client
.PHONY: init clean format lint dev build deploy help
init:
@ln -sf $(CURDIR)/.hooks/pre-commit.sh .git/hooks/pre-commit
@pnpm install --frozen-lockfile
clean:
@rm -rf dist/
distclean: clean
@rm -rf node_modules/
format:
@pnpm run format
lint:
@pnpm run lint
dev:
@pnpm run dev
build: clean
@pnpm run build
update:
@pnpm update --interactive --latest
@pnpm self-update
deploy: build
@echo "Ensuring site $(DEPLOY_SITE) exists"
@pnpm exec netlify sites:list --json | grep -q '"name": "$(DEPLOY_SITE)"' || \
(pnpm exec netlify sites:create --name $(DEPLOY_SITE) --account-slug zbhavyai)
@pnpm exec netlify deploy \
--site $(DEPLOY_SITE) \
--auth ${NETLIFY_AUTH_TOKEN} \
--dir dist \
--prod \
--no-build \
--message "deploy by makefile at commit: $(COMMIT_SHA)"
help:
@echo "Available targets:
@echo "init : install hook and dependencies"
@echo "clean : clean the build artifacts"
@echo "distclean : clean build artifacts and node_modules"
@echo "format : format the codebase"
@echo "lint : lint the codebase"
@echo "dev : start the development server"
@echo "build : build the project"
@echo "update : update dependencies in interactive mode"
@echo "deploy : manual deploy to staging environment"
@echo "help : display this help message"