@@ -11,11 +11,15 @@ MAKEFLAGS+=--no-builtin-rules
1111CURRENT_DIR: =$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST ) ) ) )
1212GIT_FOLDER =$(CURRENT_DIR ) /.git
1313
14- PROJECT_NAME =social-media
15- STACK_NAME =social-media-plone-org-br
14+ REPOSITORY_SETTINGS := $(shell uvx repoplone settings dump)
1615
17- VOLTO_VERSION =$(shell cat frontend/mrs.developer.json | python -c "import sys, json; print(json.load(sys.stdin) ['core']['tag'])")
18- PLONE_VERSION =$(shell cat backend/version.txt)
16+ PROJECT_NAME := $(shell echo '$(REPOSITORY_SETTINGS ) ' | jq -r '.name')
17+
18+ VOLTO_VERSION := $(shell echo '$(REPOSITORY_SETTINGS ) ' | jq -r '.frontend.volto_version')
19+ PLONE_VERSION := $(shell echo '$(REPOSITORY_SETTINGS ) ' | jq -r '.backend.base_package_version')
20+
21+ STACK_FILE := docker-compose-dev.yml
22+ DOCKER_COMPOSE := VOLTO_VERSION=$(VOLTO_VERSION ) PLONE_VERSION=$(PLONE_VERSION ) docker compose
1923
2024# We like colors
2125# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
@@ -33,6 +37,14 @@ all: install
3337help : # # This help message
3438 @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
3539
40+
41+ .PHONY : debug-settings
42+ debug-settings : # # Debug settings
43+ @echo " Debug settings"
44+ @echo " PROJECT_NAME: $( PROJECT_NAME) "
45+ @echo " VOLTO_VERSION: $( VOLTO_VERSION) "
46+ @echo " PLONE_VERSION: $( PLONE_VERSION) "
47+
3648# ##########################################
3749# Frontend
3850# ##########################################
@@ -145,28 +157,28 @@ build-images: ## Build container images
145157.PHONY : stack-start
146158stack-start : # # Local Stack: Start Services
147159 @echo " Start local Docker stack"
148- VOLTO_VERSION= $( VOLTO_VERSION ) PLONE_VERSION= $( PLONE_VERSION ) docker compose -f docker-compose.yml up -d --build
160+ $( DOCKER_COMPOSE ) -f docker-compose.yml up -d --build
149161 @echo " Now visit: http://social-media.localhost"
150162
151163.PHONY : stack-create-site
152164stack-create-site : # # Local Stack: Create a new site
153165 @echo " Create a new site in the local Docker stack"
154- VOLTO_VERSION= $( VOLTO_VERSION ) PLONE_VERSION= $( PLONE_VERSION ) docker compose -f docker-compose.yml exec backend ./docker-entrypoint.sh create-site
166+ $( DOCKER_COMPOSE ) -f docker-compose.yml exec backend ./docker-entrypoint.sh create-site
155167
156168.PHONY : stack-status
157169stack-status : # # Local Stack: Check Status
158170 @echo " Check the status of the local Docker stack"
159- @docker compose -f docker-compose.yml ps
171+ $( DOCKER_COMPOSE ) -f docker-compose.yml ps
160172
161173.PHONY : stack-stop
162174stack-stop : # # Local Stack: Stop Services
163175 @echo " Stop local Docker stack"
164- @docker compose -f docker-compose.yml stop
176+ $( DOCKER_COMPOSE ) -f docker-compose.yml stop
165177
166178.PHONY : stack-rm
167179stack-rm : # # Local Stack: Remove Services and Volumes
168180 @echo " Remove local Docker stack"
169- @docker compose -f docker-compose.yml down
181+ $( DOCKER_COMPOSE ) -f docker-compose.yml down
170182 @echo " Remove local volume data"
171183 @docker volume rm $(PROJECT_NAME ) _vol-site-data
172184
0 commit comments