Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AUTOPR] Fix example AWS-CLI v2 integration. #276

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.99.6
1.99.7
23 changes: 16 additions & 7 deletions examples/service/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion examples/service/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading