Skip to content

Commit

Permalink
Merge pull request #13 from MITLibraries/update-caller-workflows
Browse files Browse the repository at this point in the history
Update To Use New Shared Workflows
  • Loading branch information
cabutlermit authored Mar 23, 2023
2 parents 68b3e57 + 6581451 commit a6fc384
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 17 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### This is the Terraform-generated dev-build.yml workflow for the docker-matomo-dev app repository ###
name: Dev Build and Deploy Fargate Container
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document ###
### If the container requires any additional pre-build commands, uncomment and edit ###
### the PREBUILD line at the end of the document. ###
name: Dev Container Build and Deploy
on:
workflow_dispatch:
pull_request:
Expand All @@ -10,10 +13,12 @@ on:

jobs:
deploy:
name: Dev Deploy Fargate Container
uses: mitlibraries/.github/.github/workflows/fargate-shared-deploy-dev.yml@main
name: Dev Container Deploy
uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-dev.yml@main
secrets: inherit
with:
AWS_REGION: "us-east-1"
GHA_ROLE: "docker-matomo-gha-dev"
ECR: "docker-matomo-dev"
# FUNCTION: ""
# PREBUILD:
11 changes: 7 additions & 4 deletions .github/workflows/prod-promote.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
### This is the Terraform-generated prod-promote.yml workflow for the docker-matomo-prod app repository ###
name: Prod Promote Fargate Container
### This is the Terraform-generated prod-promote.yml workflow for the docker-matomo-prod repository. ###
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document. ###
name: Prod Container Promote
on:
workflow_dispatch:
release:
types: [published]

jobs:
deploy:
name: Prod Promote Fargate Container
uses: mitlibraries/.github/.github/workflows/fargate-shared-promote-prod.yml@main
name: Prod Container Promote
uses: mitlibraries/.github/.github/workflows/ecr-shared-promote-prod.yml@main
secrets: inherit
with:
AWS_REGION: "us-east-1"
GHA_ROLE_STAGE: docker-matomo-gha-stage
GHA_ROLE_PROD: docker-matomo-gha-prod
ECR_STAGE: "docker-matomo-stage"
ECR_PROD: "docker-matomo-prod"
# FUNCTION: ""

13 changes: 9 additions & 4 deletions .github/workflows/stage-build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
### This is the Terraform-generated stage-build.yml workflow for the docker-matomo-stage app repository ###
name: Stage Build and Deploy Fargate Container
### This is the Terraform-generated dev-build.yml workflow for the docker-matomo-stage app repository ###
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document ###
### If the container requires any additional pre-build commands, uncomment and edit ###
### the PREBUILD line at the end of the document. ###
name: Stage Container Build and Deploy
on:
workflow_dispatch:
push:
Expand All @@ -10,10 +13,12 @@ on:

jobs:
deploy:
name: Stage Deploy Fargate Container
uses: mitlibraries/.github/.github/workflows/fargate-shared-deploy-stage.yml@main
name: Stage Container Deploy
uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-stage.yml@main
secrets: inherit
with:
AWS_REGION: "us-east-1"
GHA_ROLE: "docker-matomo-gha-stage"
ECR: "docker-matomo-stage"
# FUNCTION: ""
# PREBUILD:
25 changes: 19 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
.PHONY: help dist-dev publish-dev dist-stage publish-stage
SHELL=/bin/bash
### This is the Terraform-generated header for docker-matomo-dev ###
### This is the Terraform-generated header for docker-matomo-dev. If ###
### this is a Lambda repo, uncomment the FUNCTION line below ###
### and review the other commented lines in the document. ###
ECR_NAME_DEV:=docker-matomo-dev
ECR_URL_DEV:=222053980223.dkr.ecr.us-east-1.amazonaws.com/docker-matomo-dev
### End of Terraform-generated header ###
# FUNCTION_DEV:=
### End of Terraform-generated header ###

help: ## Print this message
@awk 'BEGIN { FS = ":.*##"; print "Usage: make <target>\n\nTargets:" } \
Expand All @@ -21,10 +24,16 @@ publish-dev: dist-dev ## Build, tag and push (intended for developer-based manua
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.
### If this is a Lambda repo, uncomment the two lines below ###
# update-lambda-dev: ## Updates the lambda with whatever is the most recent image in the ecr (intended for developer-based manual update)
# aws lambda update-function-code --function-name $(FUNCTION_DEV) --image-uri $(ECR_URL_DEV):latest


### Terraform-generated manual shortcuts for deploying to Stage. This requires ###
### that ECR_NAME_STAGE, ECR_URL_STAGE, and FUNCTION_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 \
Expand All @@ -35,3 +44,7 @@ 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`

### If this is a Lambda repo, uncomment the two lines below ###
# update-lambda-stage: ## Updates the lambda with whatever is the most recent image in the ecr (intended for developer-based manual update)
# aws lambda update-function-code --function-name $(FUNCTION_STAGE) --image-uri $(ECR_URL_STAGE):latest

0 comments on commit a6fc384

Please sign in to comment.