Skip to content

Commit

Permalink
workflow and makefile updates
Browse files Browse the repository at this point in the history
Now that we have landed on a final version of workflows and makefiles for our projects, I need to do 1 more revision of the Workflows and makefile.

This sets up/refines all workflows and the makefile

It adds the prod promote workflow, which will not work until we deploy prod

This is a copy/paste from the ECR infrastructure output, this output is available to the devs in terraform cloud.
  • Loading branch information
zotoMIT committed Jun 16, 2022
1 parent e3c1863 commit 78bf0af
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### This is the Terraform-generated dev-build.yml workflow for the transmogrifier-dev app repository ###
name: dev Build and Deploy Fargate Container
name: Dev Build and Deploy Fargate Container
on:
workflow_dispatch:
pull_request:
Expand All @@ -10,8 +10,8 @@ on:

jobs:
deploy:
name: dev Deploy Fargate Container
uses: mitlibraries/.github/.github/workflows/fargate-shared-deploy-dev.yml@container-flows
name: Dev Deploy Fargate Container
uses: mitlibraries/.github/.github/workflows/fargate-shared-deploy-dev.yml@main
secrets: inherit
with:
AWS_REGION: "us-east-1"
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/prod-promote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
### This is the Terraform-generated prod-promote.yml workflow for the transmogrifier-prod app repository ###
name: Prod Promote Fargate Container
on:
workflow_dispatch:
release:
types: [published]

jobs:
deploy:
name: Prod Promote Fargate Container
uses: mitlibraries/.github/.github/workflows/fargate-shared-promote-prod.yml@main
secrets: inherit
with:
AWS_REGION: "us-east-1"
GHA_ROLE_STAGE: transmogrifier-gha-stage
GHA_ROLE_PROD: transmogrifier-gha-prod
ECR_STAGE: "transmogrifier-stage"
ECR_PROD: "transmogrifier-prod"
6 changes: 3 additions & 3 deletions .github/workflows/stage-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### This is the Terraform-generated stage-build.yml workflow for the transmogrifier-stage app repository ###
name: stage Build and Deploy Fargate Container
name: Stage Build and Deploy Fargate Container
on:
workflow_dispatch:
push:
Expand All @@ -10,8 +10,8 @@ on:

jobs:
deploy:
name: stage Deploy Fargate Container
uses: mitlibraries/.github/.github/workflows/fargate-shared-deploy-stage.yml@container-flows
name: Stage Deploy Fargate Container
uses: mitlibraries/.github/.github/workflows/fargate-shared-deploy-stage.yml@main
secrets: inherit
with:
AWS_REGION: "us-east-1"
Expand Down
20 changes: 18 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL=/bin/bash
DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)
### This is the Terraform-generated header for transmogrifier-dev
### This is the Terraform-generated header for transmogrifier-dev ###
ECR_NAME_DEV:=transmogrifier-dev
ECR_URL_DEV:=222053980223.dkr.ecr.us-east-1.amazonaws.com/transmogrifier-dev
### End of Terraform-generated header ###
Expand Down Expand Up @@ -31,7 +31,7 @@ mypy:
test:
pipenv run pytest --cov-report term-missing --cov=transmogrifier

### Developer Deploy Commands ###
### Terraform-generated Developer Deploy Commands for Dev environment ###
dist-dev: ## Build docker container (intended for developer-based manual build)
docker build --platform linux/amd64 \
-t $(ECR_URL_DEV):latest \
Expand All @@ -42,3 +42,19 @@ publish-dev: dist-dev ## Build, tag and push (intended for developer-based manua
docker login -u AWS -p $$(aws ecr get-login-password --region us-east-1) $(ECR_URL_DEV)
docker push $(ECR_URL_DEV):latest
docker push $(ECR_URL_DEV):`git describe --always`

### Terraform-generated manual shortcuts for deploying to Stage ###
### This requires that ECR_NAME_STAGE & ECR_URL_STAGE environment variables are set locally
### by the developer and that the developer has authenticated to the correct AWS Account.
### The values for the environment variables can be found in the stage_build.yml caller workflow.
dist-stage: ## Only use in an emergency
docker build --platform linux/amd64 \
-t $(ECR_URL_STAGE):latest \
-t $(ECR_URL_STAGE):`git describe --always` \
-t $(ECR_NAME_STAGE):latest .

publish-stage: ## Only use in an emergency
docker login -u AWS -p $$(aws ecr get-login-password --region us-east-1) $(ECR_URL_STAGE)
docker push $(ECR_URL_STAGE):latest
docker push $(ECR_URL_STAGE):`git describe --always`

0 comments on commit 78bf0af

Please sign in to comment.