11SHELL =/bin/bash
22DATETIME: =$(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. ###
66ECR_NAME_DEV := ecr-workflow-test-dev
77ECR_URL_DEV := 222053980223.dkr.ecr.us-east-1.amazonaws.com/ecr-workflow-test-dev
88CPU_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
107107publish-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