forked from cjuega/typescript-fullstack-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (34 loc) · 863 Bytes
/
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
SHELL := $(shell which bash)
# Test if the dependencies we need to run this Makefile are installed
DOCKER := $(shell command -v docker)
DOCKER_COMPOSE := $(shell command -v docker-compose)
.PHONY = deps
deps:
ifndef DOCKER
@echo "Docker is not available. Please install docker"
@exit 1
endif
ifndef DOCKER_COMPOSE
@echo "docker-compose is not available. Please install docker-compose"
@exit 1
endif
yarn install --force
# Start databases containers in background
.PHONY = start_database
start_database:
docker-compose up -d dynamodb
# Run tests
.PHONY = test
test: deps start_database
yarn test
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