Skip to content
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
30 changes: 21 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ MAKEFLAGS+=--no-builtin-rules
CURRENT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
GIT_FOLDER=$(CURRENT_DIR)/.git

PROJECT_NAME=social-media
STACK_NAME=social-media-plone-org-br
REPOSITORY_SETTINGS := $(shell uvx repoplone settings dump)

VOLTO_VERSION=$(shell cat frontend/mrs.developer.json | python -c "import sys, json; print(json.load(sys.stdin)['core']['tag'])")
PLONE_VERSION=$(shell cat backend/version.txt)
PROJECT_NAME := $(shell echo '$(REPOSITORY_SETTINGS)' | jq -r '.name')

VOLTO_VERSION := $(shell echo '$(REPOSITORY_SETTINGS)' | jq -r '.frontend.volto_version')
PLONE_VERSION := $(shell echo '$(REPOSITORY_SETTINGS)' | jq -r '.backend.base_package_version')

STACK_FILE := docker-compose-dev.yml
DOCKER_COMPOSE := VOLTO_VERSION=$(VOLTO_VERSION) PLONE_VERSION=$(PLONE_VERSION) docker compose

# We like colors
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects
Expand All @@ -33,6 +37,14 @@ all: install
help: ## This help message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'


.PHONY: debug-settings
debug-settings: ## Debug settings
@echo "Debug settings"
@echo "PROJECT_NAME: $(PROJECT_NAME)"
@echo "VOLTO_VERSION: $(VOLTO_VERSION)"
@echo "PLONE_VERSION: $(PLONE_VERSION)"

###########################################
# Frontend
###########################################
Expand Down Expand Up @@ -145,28 +157,28 @@ build-images: ## Build container images
.PHONY: stack-start
stack-start: ## Local Stack: Start Services
@echo "Start local Docker stack"
VOLTO_VERSION=$(VOLTO_VERSION) PLONE_VERSION=$(PLONE_VERSION) docker compose -f docker-compose.yml up -d --build
$(DOCKER_COMPOSE) -f docker-compose.yml up -d --build
@echo "Now visit: http://social-media.localhost"

.PHONY: stack-create-site
stack-create-site: ## Local Stack: Create a new site
@echo "Create a new site in the local Docker stack"
VOLTO_VERSION=$(VOLTO_VERSION) PLONE_VERSION=$(PLONE_VERSION) docker compose -f docker-compose.yml exec backend ./docker-entrypoint.sh create-site
$(DOCKER_COMPOSE) -f docker-compose.yml exec backend ./docker-entrypoint.sh create-site

.PHONY: stack-status
stack-status: ## Local Stack: Check Status
@echo "Check the status of the local Docker stack"
@docker compose -f docker-compose.yml ps
$(DOCKER_COMPOSE) -f docker-compose.yml ps

.PHONY: stack-stop
stack-stop: ## Local Stack: Stop Services
@echo "Stop local Docker stack"
@docker compose -f docker-compose.yml stop
$(DOCKER_COMPOSE) -f docker-compose.yml stop

.PHONY: stack-rm
stack-rm: ## Local Stack: Remove Services and Volumes
@echo "Remove local Docker stack"
@docker compose -f docker-compose.yml down
$(DOCKER_COMPOSE) -f docker-compose.yml down
@echo "Remove local volume data"
@docker volume rm $(PROJECT_NAME)_vol-site-data

Expand Down
1 change: 1 addition & 0 deletions news/+repository.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update repository.toml and the root Makefile. @ericof
3 changes: 3 additions & 0 deletions repository.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "social-media"
changelog = "CHANGELOG.md"
version = "version.txt"
container_images_prefix = "ghcr.io/plonegovbr/social-media"
compose = ["docker-compose.yml"]

[repository.towncrier]
Expand All @@ -11,6 +12,7 @@ settings = "towncrier.toml"
[backend.package]
name = "plonegovbr.socialmedia"
path = "backend"
code_path = "src/plonegovbr/socialmedia"
changelog = "backend/CHANGELOG.md"
towncrier_settings = "backend/pyproject.toml"
base_package = "Products.CMFPlone"
Expand All @@ -19,6 +21,7 @@ publish = true
[frontend.package]
name = "@plonegovbr/volto-social-media"
path = "frontend/packages/volto-social-media"
code_path = "src"
changelog = "frontend/packages/volto-social-media/CHANGELOG.md"
towncrier_settings = "frontend/packages/volto-social-media/towncrier.toml"
base_package = "@plone/volto"
Expand Down