Skip to content

Commit 5166afb

Browse files
authored
Merge pull request #9 from MITLibraries/update-caller-workflows
Update caller workflows for build and deploy automation
2 parents 6d731bd + fe0fe2b commit 5166afb

File tree

4 files changed

+31
-17
lines changed

4 files changed

+31
-17
lines changed

.github/workflows/dev-build.yml

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
### This is the Terraform-generated dev-build.yml workflow for the wcd2reshare-dev app repository ###
2-
name: Dev Build and Deploy lambda Container
2+
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document ###
3+
### If the container requires any additional pre-build commands, uncomment and edit ###
4+
### the PREBUILD line at the end of the document. ###
5+
name: Dev Container Build and Deploy
36
on:
47
workflow_dispatch:
58
pull_request:
@@ -10,11 +13,12 @@ on:
1013

1114
jobs:
1215
deploy:
13-
name: Dev Deploy lambda Container
14-
uses: mitlibraries/.github/.github/workflows/lambda-shared-deploy-dev.yml@main
16+
name: Dev Container Deploy
17+
uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-dev.yml@main
1518
secrets: inherit
1619
with:
1720
AWS_REGION: "us-east-1"
1821
GHA_ROLE: "wcd2reshare-gha-dev"
1922
ECR: "wcd2reshare-dev"
2023
FUNCTION: "wcd2reshare-dev"
24+
# PREBUILD:

.github/workflows/prod-promote.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
### This is the Terraform-generated prod-promote.yml workflow for the wcd2reshare-prod app repository ###
2-
name: Prod Promote Lambda Container
1+
### This is the Terraform-generated prod-promote.yml workflow for the wcd2reshare-prod repository. ###
2+
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document. ###
3+
name: Prod Container Promote
34
on:
45
workflow_dispatch:
56
release:
67
types: [published]
78

89
jobs:
910
deploy:
10-
name: Prod Promote Lambda Container
11-
uses: mitlibraries/.github/.github/workflows/lambda-shared-promote-prod.yml@main
11+
name: Prod Container Promote
12+
uses: mitlibraries/.github/.github/workflows/ecr-shared-promote-prod.yml@main
1213
secrets: inherit
1314
with:
1415
AWS_REGION: "us-east-1"

.github/workflows/stage-build.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
### This is the Terraform-generated stage-build.yml workflow for the wcd2reshare-stage repository ###
2-
name: Stage Build and Deploy Lambda Container
1+
### This is the Terraform-generated dev-build.yml workflow for the wcd2reshare-stage app repository ###
2+
### If this is a Lambda repo, uncomment the FUNCTION line at the end of the document ###
3+
### If the container requires any additional pre-build commands, uncomment and edit ###
4+
### the PREBUILD line at the end of the document. ###
5+
name: Stage Container Build and Deploy
36
on:
47
workflow_dispatch:
58
push:
@@ -10,11 +13,12 @@ on:
1013

1114
jobs:
1215
deploy:
13-
name: Stage Deploy Lambda Container
14-
uses: mitlibraries/.github/.github/workflows/lambda-shared-deploy-stage.yml@main
16+
name: Stage Container Deploy
17+
uses: mitlibraries/.github/.github/workflows/ecr-shared-deploy-stage.yml@main
1518
secrets: inherit
1619
with:
1720
AWS_REGION: "us-east-1"
1821
GHA_ROLE: "wcd2reshare-gha-stage"
1922
ECR: "wcd2reshare-stage"
2023
FUNCTION: "wcd2reshare-stage"
24+
# PREBUILD:

Makefile

+11-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
### This is the Terraform-generated header for wcd2reshare-dev ###
1+
### This is the Terraform-generated header for wcd2reshare-dev. If ###
2+
### this is a Lambda repo, uncomment the FUNCTION line below ###
3+
### and review the other commented lines in the document. ###
24
ECR_NAME_DEV:=wcd2reshare-dev
35
ECR_URL_DEV:=222053980223.dkr.ecr.us-east-1.amazonaws.com/wcd2reshare-dev
46
FUNCTION_DEV:=wcd2reshare-dev
5-
### End of Terraform-generated header ###
7+
### End of Terraform-generated header ###
68

79
### Dependency commands ###
810
install: ## Install dependencies
@@ -51,14 +53,16 @@ publish-dev: dist-dev ## Build, tag and push (intended for developer-based manua
5153
docker push $(ECR_URL_DEV):latest
5254
docker push $(ECR_URL_DEV):`git describe --always`
5355

56+
### If this is a Lambda repo, uncomment the two lines below ###
5457
update-lambda-dev: ## Updates the lambda with whatever is the most recent image in the ecr (intended for developer-based manual update)
5558
aws lambda update-function-code --function-name $(FUNCTION_DEV) --image-uri $(ECR_URL_DEV):latest
5659

5760

58-
### Terraform-generated manual shortcuts for deploying to Stage ###
59-
### This requires that ECR_NAME_STAGE, ECR_URL_STAGE, and FUNCTION_STAGE environment variables are
60-
### set locally by the developer and that the developer has authenticated to the correct AWS Account.
61-
### The values for the environment variables can be found in the stage_build.yml caller workflow.
61+
### Terraform-generated manual shortcuts for deploying to Stage. This requires ###
62+
### that ECR_NAME_STAGE, ECR_URL_STAGE, and FUNCTION_STAGE environment ###
63+
### variables are set locally by the developer and that the developer has ###
64+
### authenticated to the correct AWS Account. The values for the environment ###
65+
### variables can be found in the stage_build.yml caller workflow. ###
6266
dist-stage: ## Only use in an emergency
6367
docker build --platform linux/amd64 \
6468
-t $(ECR_URL_STAGE):latest \
@@ -70,5 +74,6 @@ publish-stage: ## Only use in an emergency
7074
docker push $(ECR_URL_STAGE):latest
7175
docker push $(ECR_URL_STAGE):`git describe --always`
7276

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

0 commit comments

Comments
 (0)