-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
78 lines (60 loc) · 2.64 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
.PHONY: up ## docker up docker container
up: files-copy
docker-compose -f ./environment/development.yml --env-file .env up -d --remove-orphans
.PHONY: build ## docker build docker image
build: files-copy
docker-compose -f ./environment/development.yml --env-file .env build
.PHONY: down ## docker stop docker container
down:
docker-compose -f ./environment/development.yml down --remove-orphans
.PHONY: npm install ## run npm install inside docker container
npm-install:
docker exec -it backend-app-tracker sh -c "npm install"
.PHONY: db-create ## create postgres database
db-create:
docker exec -it database-app-tracker sh -c "bash /docker-entrypoint-initdb.d/createdb.sh"
.PHONY: db-migrate ## run migration
db-migrate:
docker exec -it backend-app-tracker sh -c "npm run migrate"
.PHONY: db-seed ## run database seeding
db-seed:
docker exec -it backend-app-tracker sh -c "npm run db:seed"
.PHONY: files-copy ## copy necessary files
files-copy:
cp ./environment/postgres/docker-entrypoint-initdb.d/createdb.sh.example ./environment/postgres/docker-entrypoint-initdb.d/createdb.sh
cp ./config/env.dev ./.env
.PHONY: db-list ## list all database tables
db-list:
docker exec -it database-app-tracker sh -c "psql -l"
.PHONY: postgres-extension ## install all extensions for postgres
postgres-extension:
docker exec -it database-app-tracker sh -c "bash /docker-entrypoint-initdb.d/createExtension.sh"
.PHONY: backend-dev ## run backend with development mode
backend-dev:
docker exec -it backend-app-tracker sh -c "npm run dev"
.PHONY: frontend-build ## build frontend with production mode
frontend-build:
docker exec -it frontend-app-tracker sh -c "yarn install && yarn run build:prod"
.PHONY: prod ## start job tracker web application in production mode
prod:
cp ./config/env.prod ./.env
docker exec -i frontend-app-tracker sh -c "yarn install && yarn run build:prod"
docker exec -it backend-app-tracker sh -c "npm run install && npm run start"
.PHONY: host ## add domain host into your host file
host:
sudo -- sh -c -e "echo '127.0.0.1 api.jobtracker.local\n127.0.0.1 jobtracker.local' >> /etc/hosts"
.PHONY: terraform-validate ## validate terraform plan
terraform-validate:
terraform -chdir=deployment validate
.PHONY: terraform-init ## initialize terraform
terraform-init:
terraform -chdir=deployment init
.PHONY: terraform-plan ## show entire terraform plan
terraform-plan:
terraform -chdir=deployment plan
.PHONY: terraform-apply ## run terraform plan with actual result
terraform-apply:
terraform -chdir=deployment apply -auto-approve
.PHONY: terraform-destroy ## destroy instance with terraform
terraform-destroy:
terraform -chdir=deployment destroy -auto-approve