Skip to content

Commit

Permalink
Merge pull request #22 from MITLibraries/makefile-update-prod
Browse files Browse the repository at this point in the history
Update makefile with prod infrastructure commands
  • Loading branch information
zotoMIT committed Dec 10, 2021
2 parents e8fd716 + 5709837 commit e4a6cc9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 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
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ docker run submitter:latest --
note: the application requires being run in an environment with Roles based access to the AWS resources. in addition, the environment must have WORKSPACE and SSM_PATH variables set according to stage and prod conventions.

## Makefile Info
### Run-Stage
### run-stage
Run-stage is outputted by the terraform used to create the infrastructure and copy/pasted here for convenience.
Calling run-stage will execute the latest version of the container in the stage environment using the MITVPC.
Calling run-stage will execute the latest version of the container in the stage environment using the MITVPC.

### run-prod
run-prod is just like run-stage, except it runs the prod infrastructure version

0 comments on commit e4a6cc9

Please sign in to comment.