From 5808209ad3b93428bcbcc3ad87fb0e70b2373b44 Mon Sep 17 00:00:00 2001 From: George J Padayatti Date: Wed, 10 Jan 2024 16:39:52 +0530 Subject: [PATCH] Upd: Pass/override container images on runtime Signed-off-by: George J Padayatti --- Makefile | 10 +++++++++- test/test-docker-compose.yaml | 12 ++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 0d91433..897c7a2 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,14 @@ help: @echo "------------------------------------------------------------------------" @grep -E '^[0-9a-zA-Z_/%\-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' +# You can customize the default values or override them by passing parameters +export MONGODB_IMAGE ?= zcube/bitnami-compat-mongodb:6.0.5 +export POSTGRESQL_IMAGE ?= bitnami/postgresql:14.10.0 +export KEYCLOAK_IMAGE ?= docker.io/bitnami/keycloak:22.0.2-debian-11-r0 +export API_IMAGE ?= igrantio/bb-consent-api:2023.12.2 +export CADDY_IMAGE ?= igrantio/bb-consent-caddy:2023.12.2 +export FIXTURES_IMAGE ?= igrantio/bb-consent-fixtures:2023.12.2 + destroy: ## Delete all containers and volumes @if [ -n "$$(docker container ls -aq)" ]; then \ docker container rm -f $$(docker container ls -aq); \ @@ -31,7 +39,7 @@ build-test: ## Build behave image docker build --platform=linux/amd64 -t igrantio/bb-consent-test-runner:dev -f Dockerfile . run-test: ## Run BDD test - docker run --network=test_custom_network -v ./allure-results:/tests/allure-results -v ./allure-report:/tests/allure-report igrantio/bb-consent-test-runner:dev + docker run --network=test_custom_network -v ./allure-results:/tests/allure-results igrantio/bb-consent-test-runner:dev setup-dev: ## Setup api, admin and privacy dashboard for development branch tests sudo rm -rf temp && \ diff --git a/test/test-docker-compose.yaml b/test/test-docker-compose.yaml index 4cb98d5..a15ac22 100644 --- a/test/test-docker-compose.yaml +++ b/test/test-docker-compose.yaml @@ -2,7 +2,7 @@ version: "3.7" services: mongo: - image: zcube/bitnami-compat-mongodb:6.0.5 + image: ${MONGODB_IMAGE:-zcube/bitnami-compat-mongodb:6.0.5} container_name: mongo environment: - MONGODB_DATABASE=bb-consent-consentdb @@ -13,7 +13,7 @@ services: - custom_network postgresql: - image: bitnami/postgresql:14.10.0 + image: ${POSTGRESQL_IMAGE:-bitnami/postgresql:14.10.0} container_name: postgresql environment: - POSTGRESQL_USERNAME=bn_keycloak @@ -23,7 +23,7 @@ services: - custom_network keycloak: - image: docker.io/bitnami/keycloak:22.0.2-debian-11-r0 + image: ${KEYCLOAK_IMAGE:-docker.io/bitnami/keycloak:22.0.2-debian-11-r0} container_name: keycloak restart: always environment: @@ -44,7 +44,7 @@ services: - custom_network api: - image: igrantio/bb-consent-api:2023.12.2 + image: ${API_IMAGE:-igrantio/bb-consent-api:2023.12.2} container_name: api restart: always ports: @@ -58,7 +58,7 @@ services: - custom_network caddy: - image: igrantio/bb-consent-caddy:2023.12.2 + image: ${CADDY_IMAGE:-igrantio/bb-consent-caddy:2023.12.2} container_name: caddy ports: - "3333:80" @@ -73,7 +73,7 @@ services: - custom_network fixtures: - image: igrantio/bb-consent-fixtures:2023.12.2 + image: ${FIXTURES_IMAGE:-igrantio/bb-consent-fixtures:2023.12.2} container_name: fixtures volumes: - ./test-data.json:/app/data.json:ro