-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
40 lines (29 loc) · 1.09 KB
/
Makefile
File metadata and controls
40 lines (29 loc) · 1.09 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
SHELL := /bin/bash
.PHONY: deploy-api deploy-front init-db remove-db dev-api build-api stop
init-db:
source ./db/init.sh
docker-compose up -d --build db
remove-db:
docker compose rm --stop --volumes --force
rm .env || true
rm ./db/createdb.sql || true
dev-api:
docker-compose up -d db
nx serve api
build-api:
nx build api --prod
docker-compose build api
random_tag := $(shell cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 2 | head -n 1)
deploy-api:
nx build api --prod
@echo "Tag: $(shell date +%y%m%d)$(random_tag)"
docker build -t black000fox/keepsy:api-$(shell date +%y%m%d)$(random_tag) -f ./apps/api/Dockerfile .
docker push black000fox/keepsy:api-$(shell date +%y%m%d)$(random_tag)
random_FE_tag := $(shell cat /dev/urandom | tr -dc 'a-zA-Z' | fold -w 2 | head -n 1)
deploy-front:
nx build front --prod
@echo "Tag: $(shell date +%y%m%d)$(random_FE_tag)"
docker build -t black000fox/keepsy:front-$(shell date +%y%m%d)$(random_FE_tag) -f ./apps/front/Dockerfile .
docker push black000fox/keepsy:front-$(shell date +%y%m%d)$(random_FE_tag)
stop:
docker-compose stop