-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
63 lines (55 loc) · 1.61 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
SHELL := $(shell which bash)
# Test if the dependencies we need to run this Makefile are installed
DOCKER := $(shell command -v docker)
.PHONY = deps
deps:
ifndef DOCKER
@echo "Docker is not available. Please install docker"
@exit 1
endif
ifndef GITHUB_ACTIONS
yarn install --force
else
yarn install --force >/dev/null 2>&1
endif
# Start infrastructure containers in background
.PHONY = start_infra
start_infra:
docker compose up -d --wait
# Start infrastructure containers in background for CI
.PHONY = start_infra_ci
start_infra_ci:
ifndef GITHUB_ACTIONS
docker compose up -d --wait dynamodb redis mysql mongo elasticsearch opensearch-node1 opensearch-node2 kafka rabbitmq
else
docker compose up -d --wait dynamodb >/dev/null 2>&1
endif
# Start databases containers in background
.PHONY = start_database
start_database:
docker compose up -d --wait dynamodb redis mysql mongo elasticsearch opensearch-node1 opensearch-node2
# Start messaging containers in background
.PHONY = start_messaging
start_messaging:
docker compose up -d --wait kafka kafka-ui rabbitmq
# Run tests
.PHONY = test
test: deps start_infra_ci
yarn test
yarn lint
# Integration tests with all the containers are reaching the free tier limits in Github Actions.
# So we are not running them in Github Actions.
.PHONY = test_gh
test_gh: deps start_infra_ci
yarn build && yarn test:unit && yarn test:features
yarn lint
# Deploy code to an environment in AWS (cicd by default)
env = cicd
.PHONY = deploy
deploy:
yarn restoreSetup:aws $(env)
yarn deploy:aws $(env)
# Clean containers
.PHONY = clean
clean:
docker compose down --rmi local --volumes --remove-orphans