Skip to content

Commit a528b23

Browse files
authored
Merge pull request #25 from MITLibraries/final-test-new-workflows
Move Workflow Calls to Main
2 parents db4b9e2 + 18f1395 commit a528b23

File tree

4 files changed

+24
-34
lines changed

4 files changed

+24
-34
lines changed

.github/workflows/dev-build.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
### This is the Terraform-generated dev-build.yml workflow for the ecr-workflow-test 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. ###
1+
### This is the Terraform-generated dev-build.yml workflow for the ###
2+
### ecr-workflow-test-dev app repository. ###
3+
### If this is a Lambda repo, uncomment the FUNCTION line at the end of ###
4+
### the document. If the container requires any additional pre-build ###
5+
### commands, uncomment and edit the PREBUILD line at the end of the ###
6+
### document. ###
7+
58
name: Dev Container Build and Deploy
69
on:
710
workflow_dispatch:
@@ -46,7 +49,7 @@ jobs:
4649
deploy:
4750
needs: prep
4851
name: Dev Deploy
49-
uses: mitlibraries/.github/.github/workflows/ecr-multi-arch-deploy-dev.yml@multi-arch-deploy
52+
uses: mitlibraries/.github/.github/workflows/ecr-multi-arch-deploy-dev.yml@main
5053
secrets: inherit
5154
with:
5255
AWS_REGION: "us-east-1"

.github/workflows/prod-promote.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
deploy:
4242
needs: prep
4343
name: Deploy
44-
uses: mitlibraries/.github/.github/workflows/ecr-multi-arch-promote-prod.yml@multi-arch-deploy
44+
uses: mitlibraries/.github/.github/workflows/ecr-multi-arch-promote-prod.yml@main
4545
secrets: inherit
4646
with:
4747
AWS_REGION: "us-east-1"

.github/workflows/stage-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
deploy:
4747
needs: prep
4848
name: Stage Deploy
49-
uses: mitlibraries/.github/.github/workflows/ecr-multi-arch-deploy-stage.yml@multi-arch-deploy
49+
uses: mitlibraries/.github/.github/workflows/ecr-multi-arch-deploy-stage.yml@main
5050
secrets: inherit
5151
with:
5252
AWS_REGION: "us-east-1"

Makefile

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
SHELL=/bin/bash
22
DATETIME:=$(shell date -u +%Y%m%dT%H%M%SZ)
33
### This is the Terraform-generated header for ecr-workflow-test-dev. If ###
4-
### this is a Lambda repo, uncomment the FUNCTION line below ###
5-
### and review the other commented lines in the document. ###
4+
### this is a Lambda repo, uncomment the FUNCTION line below and review ###
5+
### the other commented lines in the document. ###
66
ECR_NAME_DEV := ecr-workflow-test-dev
77
ECR_URL_DEV := 222053980223.dkr.ecr.us-east-1.amazonaws.com/ecr-workflow-test-dev
88
CPU_ARCH ?= $(shell cat .aws-architecture 2>/dev/null || echo "linux/amd64")
@@ -92,16 +92,16 @@ check-arch:
9292
echo "latest" > .arch_tag; \
9393
fi
9494

95-
dist-dev: check-arch ## Build docker container (intended for developer-based manual build
95+
dist-dev: check-arch ## Build docker container (intended for developer-based manual build)
9696
@ARCH_TAG=$$(cat .arch_tag); \
9797
docker buildx inspect $(ECR_NAME_DEV) >/dev/null 2>&1 || docker buildx create --name $(ECR_NAME_DEV) --use; \
9898
docker buildx use $(ECR_NAME_DEV); \
9999
docker buildx build --platform $(CPU_ARCH) \
100-
--load \
101-
-t $(ECR_URL_DEV):make-$$ARCH_TAG \
102-
-t $(ECR_URL_DEV):make-$(shell git describe --always) \
103-
-t $(ECR_URL_DEV):make-$(shell echo $(CPU_ARCH) | cut -d'/' -f2) \
104-
-t $(ECR_NAME_DEV):$$ARCH_TAG \
100+
--load \
101+
--tag $(ECR_URL_DEV):make-$$ARCH_TAG \
102+
--tag $(ECR_URL_DEV):make-$(shell git describe --always) \
103+
--tag $(ECR_URL_DEV):make-$(shell echo $(CPU_ARCH) | cut -d'/' -f2) \
104+
--tag $(ECR_NAME_DEV):$$ARCH_TAG \
105105
.
106106

107107
publish-dev: dist-dev ## Build, tag and push (intended for developer-based manual publish)
@@ -121,23 +121,10 @@ docker-clean: ## Clean up Docker detritus
121121
docker buildx rm $(ECR_NAME_DEV) || true
122122
@rm -rf .arch_tag
123123

124-
125-
### Terraform-generated manual shortcuts for deploying to Stage. This requires ###
126-
### that ECR_NAME_STAGE, ECR_URL_STAGE, and FUNCTION_STAGE environment ###
127-
### variables are set locally by the developer and that the developer has ###
128-
### authenticated to the correct AWS Account. The values for the environment ###
129-
### variables can be found in the stage_build.yml caller workflow. ###
130-
dist-stage: ## Only use in an emergency
131-
docker buildx create --use && docker buildx build --platform $(CPU_ARCH) \
132-
-t $(ECR_URL_STAGE):latest \
133-
-t $(ECR_URL_STAGE):$(shell git describe --always) \
134-
-t $(ECR_NAME_STAGE):latest .
135-
136-
publish-stage: ## Only use in an emergency
137-
docker login -u AWS -p $$(aws ecr get-login-password --region us-east-1) $(ECR_URL_STAGE)
138-
docker push $(ECR_URL_STAGE):latest
139-
docker push $(ECR_URL_STAGE):$(shell git describe --always)
140-
141124
### If this is a Lambda repo, uncomment the two lines below ###
142-
# update-lambda-stage: ## Updates the lambda with whatever is the most recent image in the ecr (intended for developer-based manual update)
143-
# aws lambda update-function-code --function-name $(FUNCTION_STAGE) --image-uri $(ECR_URL_STAGE):latest
125+
# update-lambda-dev: ## Updates the lambda with whatever is the most recent image in the ecr (intended for developer-based manual update)
126+
# @ARCH_TAG=$$(cat .arch_tag); \
127+
# aws lambda update-function-code \
128+
# --region us-east-1 \
129+
# --function-name $(FUNCTION_DEV) \
130+
# --image-uri $(ECR_URL_DEV):make-$$ARCH_TAG

0 commit comments

Comments
 (0)