From 5be42808280ba753d3e06d01f5b28b09ce14b6ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Placzy=C5=84ski?= Date: Wed, 24 Apr 2024 15:41:59 +0200 Subject: [PATCH] [#849] Add a target to build a docker image for analytics-dashboard Included a target in the Makefile to facilitate the creation of a Docker image for the analytics-dashboard component. This addition enables the generation and pushing of the analytics-dashboard Docker image as part of the deployment process. By introducing this functionality, the build process now encompasses the analytics-dashboard, supporting the user story's aim of configuring the sanchogov.tools sub-domain for the analytics service. --- scripts/govtool/Makefile | 3 ++- scripts/govtool/analytics-dashboard.mk | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 scripts/govtool/analytics-dashboard.mk diff --git a/scripts/govtool/Makefile b/scripts/govtool/Makefile index 3fab57890..d6711a7bb 100644 --- a/scripts/govtool/Makefile +++ b/scripts/govtool/Makefile @@ -2,6 +2,7 @@ include backend.mk include frontend.mk include status-service.mk include metadata-validation.mk +include analytics-dashboard.mk include utils.mk include info.mk include config.mk @@ -16,7 +17,7 @@ cardano_db_sync_image_tag := sancho-4-2-1 all: deploy-stack notify .PHONY: deploy-stack -deploy-stack: upload-config push-backend push-frontend push-status-service push-metadata-validation +deploy-stack: upload-config push-backend push-frontend push-status-service push-metadata-validation push-analytics-dashboard @:$(call check_defined, cardano_network) @:$(call check_defined, env) export CARDANO_NETWORK=$(cardano_network); \ diff --git a/scripts/govtool/analytics-dashboard.mk b/scripts/govtool/analytics-dashboard.mk new file mode 100644 index 000000000..53d3060f0 --- /dev/null +++ b/scripts/govtool/analytics-dashboard.mk @@ -0,0 +1,20 @@ +common_mk := common.mk +ifeq ($(origin $(common_mk)), undefined) + $(eval $(common_mk) := included) + include $(common_mk) +endif + +.DEFAULT_GOAL := push-analytics-dashboard + +# image tags +analytics-dashboard_image_tag := $(shell git log -n 1 --format="%H" -- $(root_dir)/govtool/analytics-dashboard) + +.PHONY: build-analytics-dashboard +build-analytics-dashboard: + $(call check_image_on_ecr,analytics-dashboard,$(analytics-dashboard_image_tag)) || \ + $(docker) build --build-arg BASE_IMAGE_TAG=$(base_analytics-dashboard_image_tag) --tag "$(repo_url)/analytics-dashboard:$(analytics-dashboard_image_tag)" $(root_dir)/govtool/analytics-dashboard + +.PHONY: push-analytics-dashboard +push-analytics-dashboard: build-analytics-dashboard + $(call check_image_on_ecr,analytics-dashboard,$(analytics-dashboard_image_tag)) || \ + $(docker) push $(repo_url)/analytics-dashboard:$(analytics-dashboard_image_tag)