-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathMakefile
75 lines (60 loc) · 2.27 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
.PHONY : \
release-build
# Docker user configuration
# This logic is to avoid issues with permissions and mounting local volumes,
# which should be owned by the same UID for Linux distros. Mac OS can use root,
# but it is best practice to run things as with least permission where possible
# Can be set by adding user=<username> and/ or uid=<id> after the make command
# If variables are not set explicitly: try looking up values from current
# environment, otherwise fixed defaults.
# uid= defaults to 0 if user= set (which makes sense if user=root, otherwise you
# probably want to set uid as well).
ifeq ($(user),)
RUN_USER ?= $(or $(strip $(USER)),nodummy)
RUN_UID ?= $(or $(strip $(shell id -u)),4000)
else
RUN_USER = $(user)
RUN_UID = $(or $(strip $(uid)),0)
endif
export RUN_USER
export RUN_UID
##################################################
# Release
##################################################
release-build:
docker buildx build \
--target release \
--platform=linux/amd64 \
--build-arg RUN_USER=$(RUN_USER) \
--build-arg RUN_UID=$(RUN_UID) \
$(OPTS) \
.
##################################################
# Local development
##################################################
build-dev: # Build the Next.js local dev server in Docker
docker compose build --no-cache nextjs
build-storybook: # Build Storybook in Docker
docker compose build --no-cache storybook
reinstall-deps:
rm -rf node_modules
npm install
dev: # Run the Next.js local dev server in Docker
docker compose up --detach nextjs
docker compose logs --follow nextjs
storybook: # Run the Storybook local dev server in Docker
docker compose up --detach storybook
docker compose logs --follow storybook
stop:
docker compose down
##################################################
# Load testing
##################################################
load-test-local: # Load test the local environment at localhost:3000
artillery run -e local artillery-load-test.yml
load-test-dev: # Load test the dev environment in aws
artillery run -e dev artillery-load-test.yml
load-test-staging: # Load test the staging environment in aws
artillery run -e stage artillery-load-test.yml
load-test-prod: # Load test the production environment in aws. Please test responsibly
artillery run -e prod artillery-load-test.yml