forked from edmore/application-iac
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (48 loc) · 2.5 KB
/
Makefile
File metadata and controls
59 lines (48 loc) · 2.5 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
.PHONY: help create destroy status apply deploy
SERVICE_NAME ?= "app-deploy"
WORKING_DIR ?= "$(shell pwd)"
.DEFAULT: help
help:
@echo "Make Help for $(SERVICE_NAME)"
@echo ""
@echo "make create-backend - creates storage for state file"
@echo "make create - create infrastructure"
@echo "make deploy - deploy application"
@echo "make destroy - destroy infrastructure"
@echo "make status - check infrastructure status and generate graph of infrastructure"
create-backend:
docker-compose run app-deploy -cmd create-backend
delete-backend:
docker-compose run app-deploy -cmd delete-backend
create:
docker-compose run app-deploy -cmd create
destroy:
docker-compose run app-deploy -cmd destroy
status:
docker-compose run app-deploy -cmd status
create-route:
docker-compose run app-deploy -cmd create-route
delete-route:
docker-compose run app-deploy -cmd delete-route
deploy:
aws ecr get-login-password --profile ${AWS_PROFILE} --region ${AWS_DEFAULT_REGION} | docker login --username AWS --password-stdin ${ACCOUNT}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com
@echo "Deploying app"
cd $(WORKING_DIR)/terraform/application-wrapper/applications ; git clone -b ${APP_GIT_BRANCH} --single-branch "https://${APP_GIT_REPOSITORY}" app
cd $(WORKING_DIR)/terraform/application-wrapper/applications/app ; docker buildx build --platform linux/amd64 --progress=plain -t pennsieve/${APP_NAME} .
docker tag pennsieve/${APP_NAME} ${APP_REPO}
docker push ${APP_REPO}
rm -rf $(WORKING_DIR)/terraform/application-wrapper/applications/app
@echo "Deploying post processor"
cd $(WORKING_DIR)/terraform/post-processor; docker buildx build --platform linux/amd64 --progress=plain -t pennsieve/post-processor .
docker tag pennsieve/post-processor ${POST_PROCESSOR_REPO}
docker push ${POST_PROCESSOR_REPO}
@echo "Deploying workflow manager"
cd $(WORKING_DIR)/terraform/application-wrapper/applications ; git clone -b ${WM_GIT_BRANCH} --single-branch "https://${WM_GIT_REPOSITORY}" app
cd $(WORKING_DIR)/terraform/application-wrapper/applications/app ; docker buildx build --platform linux/amd64 --progress=plain -t pennsieve/workflow-manager .
docker tag pennsieve/workflow-manager ${WM_REPO}
docker push ${WM_REPO}
rm -rf $(WORKING_DIR)/terraform/application-wrapper/applications/app
@echo "Deploying pre-processor"
cd $(WORKING_DIR)/terraform/pre-processor; docker buildx build --platform linux/amd64 --progress=plain -t pennsieve/pre-processor .
docker tag pennsieve/pre-processor ${PRE_PROCESSOR_REPO}
docker push ${PRE_PROCESSOR_REPO}