From 134566a7cacc1fb93e75bbadc774bb99db5f602c Mon Sep 17 00:00:00 2001 From: nicolaasuni-vonage Date: Mon, 19 Aug 2024 15:27:26 +0100 Subject: [PATCH 1/2] Update version --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index afffa6f8..d1764bec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.99.6 +1.99.7 From db76aef9d8a36c72ff6976802d324c10be432567 Mon Sep 17 00:00:00 2001 From: nicolaasuni-vonage Date: Mon, 19 Aug 2024 15:43:02 +0100 Subject: [PATCH 2/2] Fix example AWS cli v2 integration --- examples/service/Makefile | 23 ++++++++++++++++------- examples/service/go.mod | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/examples/service/Makefile b/examples/service/Makefile index 2ebd01a9..d94355ae 100644 --- a/examples/service/Makefile +++ b/examples/service/Makefile @@ -218,9 +218,13 @@ DOCKER_LOGIN_PULL="echo" # Example: "aws --profile MYENVPROFILE ecr get-login --no-include-email --region ${AWS_REGION} | sed 's|https://||'" DOCKER_LOGIN_PUSH="echo" +ECR_PROFILE_PULL= +ECR_PROFILE_PUSH= + # INT - integration environment via docker-compose ifeq ($(DEPLOY_ENV), int) - #ECR_PROFILE= + #ECR_PROFILE_PULL= + #ECR_PROFILE_PUSH= DOCKER_REGISTRY=${DOCKER_REGISTRY_DEV} #DOCKER_REGISTRY_PULL= #DOCKER_REGISTRY_PUSH= @@ -231,7 +235,8 @@ endif # Development environment ifeq ($(DEPLOY_ENV), dev) - #ECR_PROFILE= + #ECR_PROFILE_PULL= + #ECR_PROFILE_PUSH= DOCKER_REGISTRY=${DOCKER_REGISTRY_DEV} #DOCKER_REGISTRY_PULL= DOCKER_REGISTRY_PUSH=${DOCKER_REGISTRY_DEV} @@ -242,7 +247,8 @@ endif # QA environment ifeq ($(DEPLOY_ENV), qa) - #ECR_PROFILE= + #ECR_PROFILE_PULL= + #ECR_PROFILE_PUSH= DOCKER_REGISTRY=${DOCKER_REGISTRY_QA} DOCKER_REGISTRY_PULL=${DOCKER_REGISTRY_DEV} DOCKER_REGISTRY_PUSH=${DOCKER_REGISTRY_QA} @@ -252,7 +258,8 @@ endif # Production environment ifeq ($(DEPLOY_ENV), prod) - #ECR_PROFILE= + #ECR_PROFILE_PULL= + #ECR_PROFILE_PUSH= DOCKER_REGISTRY=${DOCKER_REGISTRY_PROD} DOCKER_REGISTRY_PULL=${DOCKER_REGISTRY_QA} DOCKER_REGISTRY_PUSH=${DOCKER_REGISTRY_PROD} @@ -450,21 +457,23 @@ endif # Promote docker image from DEV to PROD .PHONY: dockerpromote dockerpromote: - $(MAKE) ecrlogin ECR_REGISTRY=${DOCKER_REGISTRY_PULL} + $(MAKE) ecrlogin ECR_PROFILE="${ECR_PROFILE_PULL}" ECR_REGISTRY=${DOCKER_REGISTRY_PULL} $(DOCKER) pull "${DOCKER_REGISTRY_PULL}/${DOCKERPREFIX}${PROJECT}$(DOCKERSUFFIX):$(DOCKERTAG)" $(DOCKER) tag "${DOCKER_REGISTRY_PULL}/${DOCKERPREFIX}${PROJECT}$(DOCKERSUFFIX):$(DOCKERTAG)" "${DOCKER_REGISTRY_PUSH}/${DOCKERPREFIX}${PROJECT}$(DOCKERSUFFIX):$(DOCKERTAG)" - $(MAKE) ecrlogin ECR_REGISTRY=${DOCKER_REGISTRY_PUSH} + $(MAKE) ecrlogin ECR_PROFILE="${ECR_PROFILE_PUSH}" ECR_REGISTRY=${DOCKER_REGISTRY_PUSH} $(DOCKER) push "${DOCKER_REGISTRY_PUSH}/${DOCKERPREFIX}${PROJECT}$(DOCKERSUFFIX):$(DOCKERTAG)" + $(DOCKER) rmi -f `docker images "${DOCKER_REGISTRY_PULL}/${DOCKERPREFIX}${PROJECT}$(DOCKERSUFFIX):$(DOCKERTAG)" -q` # Push docker container to the remote repository .PHONY: dockerpush dockerpush: - $(MAKE) ecrlogin ECR_REGISTRY=${DOCKER_REGISTRY_PUSH} + $(MAKE) ecrlogin ECR_PROFILE="${ECR_PROFILE_PUSH}" ECR_REGISTRY=${DOCKER_REGISTRY_PUSH} $(DOCKER) tag "${LCVENDOR}/${PROJECT}$(DOCKERSUFFIX):latest" "${DOCKER_REGISTRY_PUSH}/${DOCKERPREFIX}${PROJECT}$(DOCKERSUFFIX):$(DOCKERTAG)" $(DOCKER) push "${DOCKER_REGISTRY_PUSH}/${DOCKERPREFIX}${PROJECT}$(DOCKERSUFFIX):$(DOCKERTAG)" $(DOCKER) tag "${LCVENDOR}/${PROJECT}$(DOCKERSUFFIX):latest" "${DOCKER_REGISTRY_PUSH}/${DOCKERPREFIX}${PROJECT}$(DOCKERSUFFIX):latest" $(DOCKER) push "${DOCKER_REGISTRY_PUSH}/${DOCKERPREFIX}${PROJECT}$(DOCKERSUFFIX):latest" +# Test the newly built docker container .PHONY: dockertest dockertest: dockertestenv dockerdev test -f "$(BINUTIL)/dockerize" || curl --silent --show-error --fail --location https://github.com/jwilder/dockerize/releases/download/v0.6.1/dockerize-linux-amd64-v0.6.1.tar.gz | tar -xz -C $(BINUTIL) diff --git a/examples/service/go.mod b/examples/service/go.mod index 64ea7ec6..637bcd30 100644 --- a/examples/service/go.mod +++ b/examples/service/go.mod @@ -7,7 +7,7 @@ toolchain go1.23.0 replace github.com/Vonage/gosrvlib => ../.. require ( - github.com/Vonage/gosrvlib v1.99.6 + github.com/Vonage/gosrvlib v1.99.7 github.com/golang/mock v1.6.0 github.com/jstemmer/go-junit-report/v2 v2.1.0 github.com/prometheus/client_golang v1.20.0