Skip to content

Commit

Permalink
Update makefile with prod infrastructure commands
Browse files Browse the repository at this point in the history
# Subject
Add two new prod infrastructure makefile commands

# Why these changes are being introduced:
These changes are needed to include makefile commands for prod infrastructure to promote the stage image from stage to prod, and run the prod infrastructure.

# How this addresses that need:
Add the two commands, which are pretty much copy/paste from mario, and copy/paste from the output of the infrastructure deploy

# Side effects of this change:
None

# Relevant ticket(s):
https://mitlibraries.atlassian.net/browse/ETD-520

# Resolves: #123 (GH issue)
NA
  • Loading branch information
zotoMIT committed Dec 10, 2021
1 parent e8fd716 commit a349043
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@ publish: dist ## Build, tag and push
docker push $(ECR_REGISTRY)/dspacesubmissionservice-stage:latest
docker push $(ECR_REGISTRY)/dspacesubmissionservice-stage:`git describe --always`

promote: ## Promote the current staging build to production
docker login -u AWS -p $$(aws ecr get-login-password --region us-east-1) $(ECR_REGISTRY)
docker pull $(ECR_REGISTRY)/dspacesubmissionservice-stage:latest
docker tag $(ECR_REGISTRY)/dspacesubmissionservice-stage:latest $(ECR_REGISTRY)/dspacesubmissionservice-prod:latest
docker tag $(ECR_REGISTRY)/dspacesubmissionservice-stage:latest $(ECR_REGISTRY)/dspacesubmissionservice-prod:$(DATETIME)
docker push $(ECR_REGISTRY)/dspacesubmissionservice-prod:latest
docker push $(ECR_REGISTRY)/dspacesubmissionservice-prod:$(DATETIME)

run-stage: ## Runs the task in stage - see readme for more info
aws ecs run-task --cluster dspacesubmissionservice-stage --task-definition dspacesubmissionservice-stage --network-configuration "awsvpcConfiguration={subnets=[subnet-0744a5c9beeb49a20],securityGroups=[sg-06b90b77a06e5870a],assignPublicIp=DISABLED}" --launch-type FARGATE --region us-east-1

run-prod: ##Runs the task in prod - see readme for more info
aws ecs run-task --cluster dspacesubmissionservice-prod --task-definition dspacesubmissionservice-prod --network-configuration "awsvpcConfiguration={subnets=[subnet-0744a5c9beeb49a20],securityGroups=[sg-0b29d571e70c05101],assignPublicIp=DISABLED}" --launch-type FARGATE --region us-east-1

lint: bandit black flake8 isort ## Runs all linters

bandit: ## Security oriented static analyser for python code
Expand Down

0 comments on commit a349043

Please sign in to comment.