This repository was archived by the owner on Apr 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
83 lines (69 loc) · 1.74 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
76
77
78
79
80
81
82
83
override APPLICATION_NAME=purr
override NODE_VERSION=21.7
DOCKER_IMAGE?=ghcr.io/semrush/purr
DOCKER_TAG?=latest
CHECK_NAME:=example-com
SUITE_NAME:=example-com-suite
.PHONY: npm-install
npm-install:
rm -r ${CURDIR}/node_modules || true
docker run --rm \
-v ${CURDIR}:/app \
-w /app \
node:${NODE_VERSION} \
npm ci
.PHONY: npm-patch-version
npm-patch-version:
rm -r ${CURDIR}/node_modules || true
docker run --rm \
-v ${CURDIR}:/app \
-w /app \
node:${NODE_VERSION} \
npm version patch --no-git-tag-version
.PHONY: vendor
vendor: npm-install
.PHONY: npm-lint
npm-lint:
docker run --rm \
-v ${CURDIR}:/app \
-w /app \
node:${NODE_VERSION} \
npm run lint
.PHONY: lint
lint: npm-lint
.PHONY: npm-test
npm-test:
docker run --rm \
-v ${CURDIR}:/app \
-w /app \
node:${NODE_VERSION} \
npm run test
.PHONY: test
test: npm-test
.PHONY: docker-build
docker-build:
docker rmi --force ${DOCKER_IMAGE}:${DOCKER_TAG} || true
docker build -f ${CURDIR}/docker/Dockerfile -t ${DOCKER_IMAGE}:${DOCKER_TAG} --progress plain --no-cache .
.PHONY: build
build: docker-build
.PHONY: docker-compose-up
docker-compose-up:
DOCKER_IMAGE=${DOCKER_IMAGE} DOCKER_TAG=${DOCKER_TAG} docker compose -p ${APPLICATION_NAME} up -d
.PHONY: docker-compose-down
docker-compose-down:
docker compose -p ${APPLICATION_NAME} down --remove-orphans --volumes --rmi local
.PHONY: run-check
run-check: docker-build
rm -r ${CURDIR}/storage/* || true
docker run --rm \
--env-file ${CURDIR}/.env \
${DOCKER_IMAGE}:${DOCKER_TAG} \
check $(CHECK_NAME)
.PHONY: run-suite
run-suite: docker-build
rm -r ${CURDIR}/storage/* || true
docker run --rm \
-v ${CURDIR}:/app \
--env-file ${CURDIR}/.env \
${DOCKER_IMAGE}:${DOCKER_TAG} \
suite $(SUITE_NAME)