-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
55 lines (41 loc) · 2.01 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
.PHONY: build_dev_images up
up: build_dev_images
docker compose up
bundled_dev: build_dev_images opensearch opensearch_dashboards postgres setup
down:
docker compose down
build_dev_images:
docker build -t swiple-api ./backend/
docker build -t swiple-ui ./frontend/
swiple_ui_install:
npm install --preifx ./frontend/
swiple_ui_dev:
npm start --preifx ./frontend/
swiple_api_dev:
python3 ./backend/main.py
integration_test:
docker compose run integration_test
opensearch:
docker compose up -d opensearch-node1
postgres:
docker compose up -d postgres
opensearch_dashboards:
docker compose up -d opensearch-dashboards
setup:
docker compose up -d setup
push_swiple_api_to_aws_ecr:
# Prerequisites: Repository has been created in AWS ECR
# Example: make push_swiple_api_to_aws_ecr AWS_ACCOUNT_ID=012345678910 REPOSITORY=swiple-api TAG=latest REGION=us-east-1
docker build -t $(REPOSITORY):$(TAG) ./backend/
$(eval IMAGE_ID=$(shell sh -c 'docker images --filter=reference=$(REPOSITORY):$(TAG) --format "{{.ID}}"'))
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(AWS_ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com
docker tag $(IMAGE_ID) $(AWS_ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com/$(REPOSITORY)
docker push $(AWS_ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com/$(REPOSITORY):$(TAG)
push_swiple_ui_to_aws_ecr:
# Prerequisites: Repository has been created in AWS ECR
# Example: make push_swiple_ui_to_aws_ecr AWS_ACCOUNT_ID=012345678910 REPOSITORY=swiple-ui TAG=latest REGION=us-east-1
docker build -t $(REPOSITORY):$(TAG) -f ./frontend/Dockerfile.prod ./frontend
$(eval IMAGE_ID=$(shell sh -c 'docker images --filter=reference=$(REPOSITORY):$(TAG) --format "{{.ID}}"'))
aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin $(AWS_ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com
docker tag $(IMAGE_ID) $(AWS_ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com/$(REPOSITORY)
docker push $(AWS_ACCOUNT_ID).dkr.ecr.$(REGION).amazonaws.com/$(REPOSITORY):$(TAG)