@@ -11,13 +11,14 @@ MAKEFLAGS+=--no-builtin-rules
1111CURRENT_DIR: =$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST ) ) ) )
1212GIT_FOLDER =$(CURRENT_DIR ) /.git
1313
14- PROJECT_NAME =pybr25-site
15- STACK_NAME =2025-pythonbrasil-org-br
16- STACK_FILE =docker-compose-dev.yml
14+ REPOSITORY_SETTINGS := $(shell uvx repoplone settings dump)
1715
16+ PROJECT_NAME := $(shell echo '$(REPOSITORY_SETTINGS ) ' | jq -r '.name')
17+ STACK_NAME =pythonbrasil-pybr25-site
1818
19- VOLTO_VERSION =$(shell cat frontend/mrs.developer.json | python -c "import sys, json; print(json.load(sys.stdin) ['core']['tag'])")
20- PLONE_VERSION =$(shell cat backend/version.txt)
19+ VOLTO_VERSION := $(shell echo '$(REPOSITORY_SETTINGS ) ' | jq -r '.frontend.volto_version')
20+ PLONE_VERSION := $(shell echo '$(REPOSITORY_SETTINGS ) ' | jq -r '.backend.base_package_version')
21+ IMAGE_PREFIX := $(shell echo '$(REPOSITORY_SETTINGS ) ' | jq -r '.container_images_prefix')
2122
2223# We like colors
2324# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
@@ -35,6 +36,13 @@ all: install
3536help : # # This help message
3637 @grep -E ' ^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST ) | sort | awk ' BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
3738
39+ .PHONY : debug-settings
40+ debug-settings : # # Debug settings
41+ @echo " Debug settings"
42+ @echo " PROJECT_NAME: $( PROJECT_NAME) "
43+ @echo " VOLTO_VERSION: $( VOLTO_VERSION) "
44+ @echo " PLONE_VERSION: $( PLONE_VERSION) "
45+
3846# ##########################################
3947# Frontend
4048# ##########################################
@@ -110,7 +118,7 @@ format: ## Format codebase
110118
111119.PHONY : lint
112120lint : # # Format codebase
113- @echo " Lint the codebasecodebase "
121+ @echo " Lint the codebase "
114122 $(MAKE ) -C " ./backend/" lint
115123 $(MAKE ) -C " ./frontend/" lint
116124
@@ -144,31 +152,32 @@ build-images: ## Build container images
144152# ##########################################
145153# Local Stack
146154# ##########################################
147- .PHONY : stack-start
148- stack-start : # # Local Stack: Start Services
149- @echo " Start local Docker stack"
150- VOLTO_VERSION=$(VOLTO_VERSION ) PLONE_VERSION=$(PLONE_VERSION ) docker compose -f $(STACK_FILE ) up -d --build
151- @echo " Now visit: http://pybr25-site.localhost"
152-
153155.PHONY : stack-create-site
154156stack-create-site : # # Local Stack: Create a new site
155157 @echo " Create a new site in the local Docker stack"
156- VOLTO_VERSION=$(VOLTO_VERSION ) PLONE_VERSION=$(PLONE_VERSION ) docker compose -f $(STACK_FILE ) exec backend ./docker-entrypoint.sh create-site
158+ @echo " (Stack must not be running already.)"
159+ VOLTO_VERSION=$(VOLTO_VERSION ) PLONE_VERSION=$(PLONE_VERSION ) docker compose -f docker-compose.yml run --build backend ./docker-entrypoint.sh create-site
160+
161+ .PHONY : stack-start
162+ stack-start : # # Local Stack: Start Services
163+ @echo " Start local Docker stack"
164+ VOLTO_VERSION=$(VOLTO_VERSION ) PLONE_VERSION=$(PLONE_VERSION ) docker compose -f docker-compose.yml up -d --build
165+ @echo " Now visit: http://pybr25.localhost"
157166
158167.PHONY : stack-status
159168stack-status : # # Local Stack: Check Status
160169 @echo " Check the status of the local Docker stack"
161- @docker compose -f $( STACK_FILE ) ps
170+ @docker compose -f docker-compose.yml ps
162171
163172.PHONY : stack-stop
164173stack-stop : # # Local Stack: Stop Services
165174 @echo " Stop local Docker stack"
166- @docker compose -f $( STACK_FILE ) stop
175+ @docker compose -f docker-compose.yml stop
167176
168177.PHONY : stack-rm
169178stack-rm : # # Local Stack: Remove Services and Volumes
170179 @echo " Remove local Docker stack"
171- @docker compose -f $( STACK_FILE ) down
180+ @docker compose -f docker-compose.yml down
172181 @echo " Remove local volume data"
173182 @docker volume rm $(PROJECT_NAME ) _vol-site-data
174183
@@ -194,12 +203,12 @@ acceptance-test:
194203.PHONY : acceptance-frontend-image-build
195204acceptance-frontend-image-build :
196205 @echo " Build acceptance frontend image"
197- @docker build frontend -t pythonbrasil/pybr25-site -frontend:acceptance -f frontend/Dockerfile --build-arg VOLTO_VERSION=$(VOLTO_VERSION )
206+ @docker build frontend -t $( IMAGE_PREFIX ) -frontend:acceptance -f frontend/Dockerfile --build-arg VOLTO_VERSION=$(VOLTO_VERSION )
198207
199208.PHONY : acceptance-backend-image-build
200209acceptance-backend-image-build :
201210 @echo " Build acceptance backend image"
202- @docker build backend -t pythonbrasil/pybr25-site -backend:acceptance -f backend/Dockerfile.acceptance --build-arg PLONE_VERSION=$(PLONE_VERSION )
211+ @docker build backend -t $( IMAGE_PREFIX ) -backend:acceptance -f backend/Dockerfile.acceptance --build-arg PLONE_VERSION=$(PLONE_VERSION )
203212
204213.PHONY : acceptance-images-build
205214acceptance-images-build : # # Build Acceptance frontend/backend images
@@ -209,12 +218,12 @@ acceptance-images-build: ## Build Acceptance frontend/backend images
209218.PHONY : acceptance-frontend-container-start
210219acceptance-frontend-container-start :
211220 @echo " Start acceptance frontend"
212- @docker run --rm -p 3000:3000 --name pybr25-site- frontend-acceptance --link pybr25-site- backend-acceptance:backend -e RAZZLE_API_PATH=http://localhost:55001/plone -e RAZZLE_INTERNAL_API_PATH=http://backend:55001/plone -d pythonbrasil/pybr25-site -frontend:acceptance
221+ @docker run --rm -p 3000:3000 --name pybr25-frontend-acceptance --link pybr25-backend-acceptance:backend -e RAZZLE_API_PATH=http://localhost:55001/plone -e RAZZLE_INTERNAL_API_PATH=http://backend:55001/plone -d $( IMAGE_PREFIX ) -frontend:acceptance
213222
214223.PHONY : acceptance-backend-container-start
215224acceptance-backend-container-start :
216225 @echo " Start acceptance backend"
217- @docker run --rm -p 55001:55001 --name pybr25-site- backend-acceptance -d pythonbrasil/pybr25-site -backend:acceptance
226+ @docker run --rm -p 55001:55001 --name pybr25-backend-acceptance -d $( IMAGE_PREFIX ) -backend:acceptance
218227
219228.PHONY : acceptance-containers-start
220229acceptance-containers-start : # # Start Acceptance containers
@@ -224,8 +233,8 @@ acceptance-containers-start: ## Start Acceptance containers
224233.PHONY : acceptance-containers-stop
225234acceptance-containers-stop : # # Stop Acceptance containers
226235 @echo " Stop acceptance containers"
227- @docker stop pybr25-site- frontend-acceptance
228- @docker stop pybr25-site- backend-acceptance
236+ @docker stop pybr25-frontend-acceptance
237+ @docker stop pybr25-backend-acceptance
229238
230239.PHONY : ci-acceptance-test
231240ci-acceptance-test :
0 commit comments