-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation of classic.demo.plone.org
- Loading branch information
Showing
71 changed files
with
3,022 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
{ "eslint.workingDirectories": ["./frontend"] } | ||
{ | ||
"eslint.workingDirectories": [ | ||
"./frontend" | ||
], | ||
"yaml.schemas": { | ||
"https://json.schemastore.org/github-workflow.json": "./.github/workflows/deploy.yml" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.editorconfig | ||
.gitattributes | ||
bin | ||
Dockerfile | ||
include | ||
instance | ||
instance.yaml | ||
lib | ||
lib64 | ||
Makefile | ||
pyvenv.cfg | ||
var |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CHANGES.md merge=union |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
.coverage | ||
*.egg-info | ||
*.log | ||
*.mo | ||
*.py? | ||
*.swp | ||
# dirs | ||
bin/ | ||
buildout-cache/ | ||
data/*.json | ||
develop-eggs/ | ||
eggs/ | ||
etc/ | ||
htmlcov/ | ||
include/ | ||
instance/ | ||
lib/ | ||
lib64/ | ||
local/ | ||
node_modules/ | ||
parts/ | ||
src/plone6demo/setuphandlers/data/*.json | ||
dist/* | ||
test.plone_addon/ | ||
var/ | ||
# files | ||
.installed.cfg | ||
.mr.developer.cfg | ||
lib64 | ||
log.html | ||
output.xml | ||
pip-selfcheck.json | ||
report.html | ||
.vscode/ | ||
.tox/ | ||
reports/ | ||
venv/ | ||
*-mxdev.txt | ||
# excludes | ||
live.cfg | ||
inituser | ||
pip-wheel-metadata | ||
pyvenv.cfg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# syntax=docker/dockerfile:1 | ||
ARG SEED=1000 | ||
ARG PLONE_VERSION=6.0.0 | ||
FROM plone/plone-backend:${PLONE_VERSION} | ||
|
||
|
||
LABEL maintainer="Plone Foundation <[email protected]>" \ | ||
org.label-schema.name="demo-classic" \ | ||
org.label-schema.description="Plone 6 Demo Site Classic image." \ | ||
org.label-schema.vendor="Plone Foundation" | ||
|
||
# Add local code | ||
COPY . . | ||
|
||
# Install local requirements and fix permissions | ||
RUN <<EOT | ||
./bin/pip install mxdev | ||
mv requirements-docker.txt requirements.txt | ||
./bin/mxdev -c mx.ini | ||
./bin/pip install -r requirements-mxdev.txt | ||
chown -R plone: /app | ||
EOT | ||
|
||
# Create a new site with content | ||
RUN <<EOT | ||
SEED=${SEED} | ||
./docker-entrypoint.sh create-site | ||
EOT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,166 @@ | ||
### Defensive settings for make: | ||
# https://tech.davis-hansson.com/p/make/ | ||
SHELL:=bash | ||
.ONESHELL: | ||
.SHELLFLAGS:=-xeu -o pipefail -O inherit_errexit -c | ||
.SILENT: | ||
.DELETE_ON_ERROR: | ||
MAKEFLAGS+=--warn-undefined-variables | ||
MAKEFLAGS+=--no-builtin-rules | ||
|
||
# We like colors | ||
# From: https://coderwall.com/p/izxssa/colored-makefile-for-golang-projects | ||
RED=`tput setaf 1` | ||
GREEN=`tput setaf 2` | ||
RESET=`tput sgr0` | ||
YELLOW=`tput setaf 3` | ||
|
||
PLONE_VERSION=6.0.0 | ||
|
||
BACKEND_FOLDER=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) | ||
|
||
CODE_QUALITY_VERSION=2.0.2 | ||
ifndef LOG_LEVEL | ||
LOG_LEVEL=INFO | ||
endif | ||
CURRENT_USER=$$(whoami) | ||
USER_INFO=$$(id -u ${CURRENT_USER}):$$(getent group ${CURRENT_USER}|cut -d: -f3) | ||
LINT=docker run --rm -e LOG_LEVEL="${LOG_LEVEL}" -v "${BACKEND_FOLDER}":/github/workspace plone/code-quality:${CODE_QUALITY_VERSION} check | ||
FORMAT=docker run --rm --user="${USER_INFO}" -e LOG_LEVEL="${LOG_LEVEL}" -v "${BACKEND_FOLDER}":/github/workspace plone/code-quality:${CODE_QUALITY_VERSION} format | ||
|
||
IMAGE_NAME=ghcr.io/plone/demo-classic | ||
IMAGE_TAG=latest | ||
|
||
# Python checks | ||
PYTHON?=python3 | ||
|
||
# installed? | ||
ifeq (, $(shell which $(PYTHON) )) | ||
$(error "PYTHON=$(PYTHON) not found in $(PATH)") | ||
endif | ||
|
||
# version ok? | ||
PYTHON_VERSION_MIN=3.8 | ||
PYTHON_VERSION_OK=$(shell $(PYTHON) -c "import sys; print((int(sys.version_info[0]), int(sys.version_info[1])) >= tuple(map(int, '$(PYTHON_VERSION_MIN)'.split('.'))))") | ||
ifeq ($(PYTHON_VERSION_OK),0) | ||
$(error "Need python $(PYTHON_VERSION) >= $(PYTHON_VERSION_MIN)") | ||
endif | ||
|
||
|
||
# Add the following 'help' target to your Makefile | ||
# And add help text after each target name starting with '\#\#' | ||
.PHONY: help | ||
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: clean | ||
clean: clean-build clean-pyc clean-test clean-venv clean-instance ## remove all build, test, coverage and Python artifacts | ||
|
||
.PHONY: clean-instance | ||
clean-instance: ## remove existing instance | ||
rm -fr instance etc inituser var | ||
|
||
.PHONY: clean-venv | ||
clean-venv: ## remove virtual environment | ||
rm -fr bin include lib lib64 | ||
|
||
.PHONY: clean-build | ||
clean-build: ## remove build artifacts | ||
rm -fr build/ | ||
rm -fr dist/ | ||
rm -fr .eggs/ | ||
find . -name '*.egg-info' -exec rm -fr {} + | ||
find . -name '*.egg' -exec rm -rf {} + | ||
|
||
.PHONY: clean-pyc | ||
clean-pyc: ## remove Python file artifacts | ||
find . -name '*.pyc' -exec rm -f {} + | ||
find . -name '*.pyo' -exec rm -f {} + | ||
find . -name '*~' -exec rm -f {} + | ||
find . -name '__pycache__' -exec rm -fr {} + | ||
|
||
.PHONY: clean-test | ||
clean-test: ## remove test and coverage artifacts | ||
rm -f .coverage | ||
rm -fr htmlcov/ | ||
|
||
bin/pip: | ||
@echo "$(GREEN)==> Setup Virtual Env$(RESET)" | ||
$(PYTHON) -m venv . | ||
bin/pip install -U "pip" "wheel" "cookiecutter" "mxdev" | ||
|
||
.PHONY: config | ||
config: bin/pip ## Create instance configuration | ||
@echo "$(GREEN)==> Create instance configuration$(RESET)" | ||
bin/cookiecutter -f --no-input --config-file instance.yaml gh:plone/cookiecutter-zope-instance | ||
|
||
# i18n | ||
bin/i18ndude: bin/pip | ||
@echo "$(GREEN)==> Install translation tools$(RESET)" | ||
bin/pip install i18ndude | ||
|
||
.PHONY: i18n | ||
i18n: bin/i18ndude ## Update locales | ||
@echo "$(GREEN)==> Updating locales$(RESET)" | ||
bin/update_locale | ||
|
||
# TODO `make build` | ||
# build: | ||
|
||
.PHONY: build-dev | ||
build-dev: config ## pip install Plone packages | ||
@echo "$(GREEN)==> Setup Build$(RESET)" | ||
bin/mxdev -c mx.ini | ||
bin/pip install -r requirements-mxdev.txt | ||
|
||
.PHONY: format | ||
format: ## Format the codebase according to our standards | ||
@echo "$(GREEN)==> Format codebase$(RESET)" | ||
$(FORMAT) | ||
|
||
.PHONY: lint | ||
lint: lint-isort lint-black lint-flake8 lint-zpretty ## check code style | ||
|
||
.PHONY: lint-black | ||
lint-black: ## validate black formating | ||
$(LINT) black | ||
|
||
.PHONY: lint-flake8 | ||
lint-flake8: ## validate black formating | ||
$(LINT) flake8 | ||
|
||
.PHONY: lint-isort | ||
lint-isort: ## validate using isort | ||
$(LINT) isort | ||
|
||
.PHONY: lint-pyroma | ||
lint-pyroma: ## validate using pyroma | ||
$(LINT) pyroma | ||
|
||
.PHONY: lint-zpretty | ||
lint-zpretty: ## validate ZCML/XML using zpretty | ||
$(LINT) zpretty | ||
|
||
.PHONY: test | ||
test: ## run tests | ||
./bin/zope-testrunner --auto-color --auto-progress --test-path src/plonedemo.site/src/ | ||
|
||
.PHONY: test_quiet | ||
test_quiet: ## run tests removing deprecation warnings | ||
PYTHONWARNINGS=ignore ./bin/zope-testrunner --auto-color --auto-progress --test-path src/plonedemo.site/src/ | ||
|
||
.PHONY: create-site | ||
create-site: instance/etc/zope.ini ## Create a new site from scratch | ||
PYTHONWARNINGS=ignore ./bin/zconsole run instance/etc/zope.conf ./scripts/create_site.py | ||
|
||
.PHONY: start | ||
start: ## Start a Plone instance on localhost:8080 | ||
PYTHONWARNINGS=ignore ./bin/runwsgi instance/etc/zope.ini | ||
|
||
.PHONY: debug | ||
debug: instance/etc/zope.ini ## Run debug console | ||
PYTHONWARNINGS=ignore ./bin/zconsole debug instance/etc/zope.conf | ||
|
||
.PHONY: build-image | ||
build-image: ## Build Docker Image | ||
@docker build . -t $(IMAGE_NAME):$(IMAGE_TAG) -f Dockerfile --build-arg PLONE_VERSION=$(PLONE_VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-c https://dist.plone.org/release/6.0.0/constraints.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
default_context: | ||
initial_user_name: 'admin' | ||
initial_user_password: 'admin' | ||
|
||
load_zcml: | ||
package_includes: ['plonedemo.site'] | ||
|
||
db_storage: direct |
Oops, something went wrong.