Skip to content

Commit

Permalink
Renamed the structure source code #82
Browse files Browse the repository at this point in the history
  • Loading branch information
macagua committed Jul 19, 2023
1 parent 6635d5f commit ae1e6a1
Show file tree
Hide file tree
Showing 90 changed files with 566 additions and 1,639 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
- name: Run tests
run: |
PYTHONWARNINGS=ignore zope-testrunner --auto-color --auto-progress --test-path src/slc_sitioweb/src/
PYTHONWARNINGS=ignore zope-testrunner --auto-color --auto-progress --test-path src/slc_web/src/
release:
runs-on: ubuntu-latest
Expand All @@ -107,9 +107,9 @@ jobs:
uses: docker/metadata-action@v4
with:
images: |
ScrumLATAMComunidad/slc-sitioweb-backend
ScrumLATAMComunidad/slc-web-backend
labels: |
org.label-schema.docker.cmd=docker run -d -p 8080:8080 ScrumLATAMComunidad/slc-sitioweb-backend:latest
org.label-schema.docker.cmd=docker run -d -p 8080:8080 ScrumLATAMComunidad/slc-web-backend:latest
flavor:
latest=false
tags: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ jobs:
uses: docker/metadata-action@v4
with:
images: |
ScrumLATAMComunidad/slc-sitioweb-frontend
ScrumLATAMComunidad/slc-web-frontend
labels: |
org.label-schema.docker.cmd=docker run -d -p 3000:3000 ScrumLATAMComunidad/slc-sitioweb-frontend:latest
org.label-schema.docker.cmd=docker run -d -p 3000:3000 ScrumLATAMComunidad/slc-web-frontend:latest
flavor:
latest=false
tags: |
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -129,22 +129,22 @@ stop-stack: ## Stop local stack
.PHONY: build-acceptance-servers
build-acceptance-servers: ## Build Acceptance Servers
@echo "Build acceptance backend"
@docker build backend -t ScrumLATAMComunidad/slc-sitioweb-backend:acceptance -f backend/Dockerfile.acceptance
@docker build backend -t ScrumLATAMComunidad/slc-web-backend:acceptance -f backend/Dockerfile.acceptance
@echo "Build acceptance frontend"
@docker build frontend -t ScrumLATAMComunidad/slc-sitioweb-frontend:acceptance -f frontend/Dockerfile
@docker build frontend -t ScrumLATAMComunidad/slc-web-frontend:acceptance -f frontend/Dockerfile

.PHONY: start-acceptance-servers
start-acceptance-servers: build-acceptance-servers ## Start Acceptance Servers
@echo "Start acceptance backend"
@docker run --rm -p 55001:55001 --name slc-sitioweb-backend-acceptance -d ScrumLATAMComunidad/slc-sitioweb-backend:acceptance
@docker run --rm -p 55001:55001 --name slc-web-backend-acceptance -d ScrumLATAMComunidad/slc-web-backend:acceptance
@echo "Start acceptance frontend"
@docker run --rm -p 3000:3000 --name slc-sitioweb-frontend-acceptance --link slc-sitioweb-backend-acceptance:backend -e RAZZLE_API_PATH=http://localhost:55001/plone -e RAZZLE_INTERNAL_API_PATH=http://backend:55001/plone -d ScrumLATAMComunidad/slc-sitioweb-frontend:acceptance
@docker run --rm -p 3000:3000 --name slc-web-frontend-acceptance --link slc-web-backend-acceptance:backend -e RAZZLE_API_PATH=http://localhost:55001/plone -e RAZZLE_INTERNAL_API_PATH=http://backend:55001/plone -d ScrumLATAMComunidad/slc-web-frontend:acceptance

.PHONY: stop-acceptance-servers
stop-acceptance-servers: ## Stop Acceptance Servers
@echo "Stop acceptance containers"
@docker stop slc-sitioweb-frontend-acceptance
@docker stop slc-sitioweb-backend-acceptance
@docker stop slc-web-frontend-acceptance
@docker stop slc-web-backend-acceptance

.PHONY: run-acceptance-tests
run-acceptance-tests: ## Run Acceptance tests
Expand Down
23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SCRUM LATAM Comunidad Website
# SCRUM LATAM Comunidad Web portal

The [Scrum Latam Comunidad](https://www.scrumlatamcomunidad.com/)
Website repository.
The [SCRUM LATAM Comunidad](https://www.scrumlatamcomunidad.com/)
Web portal repository.

[Spanish](README_es.md)

Expand All @@ -11,18 +11,17 @@ Website repository.
[![Frontend Tests](https://github.com/ScrumLATAMComunidad/scrumlatamcomunidad.com/actions/workflows/frontend.yml/badge.svg)](https://github.com/ScrumLATAMComunidad/scrumlatamcomunidad.com/actions/workflows/frontend.yml)
[![All Contributors](https://img.shields.io/github/all-contributors/ScrumLATAMComunidad/scrumlatamcomunidad.com?color=ee8449&style=flat-square)](#contributors)


The new SCRUM LATAM Comunidad Website using Plone 6 and Volto
A new SCRUM LATAM Comunidad Web portal using Plone 6 and Volto
technologies.

## Quick start

### Development Stack
### Development Setup

- Python 3.9, 3.10, 3.11
- Node 16
- yarn
- Docker
- Python 3.9, 3.10, 3.11
- Node 16
- yarn
- Docker

### Install

Expand Down Expand Up @@ -120,9 +119,9 @@ make help
This monorepo is composed by two distinct codebases: api and frontend.

- **backend**: API (Backend) Plone installation using `pip` (not
*buildout*). Includes a policy package named `slc_sitioweb`. More
*buildout*). Includes a policy package named `slc_web`. More
details information at
[backend/src/slc\_sitioweb/README.md](backend/src/slc_sitioweb/README.md)
[backend/src/slc\_web/README.md](backend/src/slc_web/README.md)
file.
- **devops**: Devops Deployments scripts por this monorepo. More
details information at [devops/README.md](devops/README.md) file.
Expand Down
12 changes: 6 additions & 6 deletions README_es.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sitio Web de SCRUM LATAM Comunidad
# Portal Web de SCRUM LATAM Comunidad

Repositorio del Sitio Web de [Scrum Latam Comunidad](https://www.scrumlatamcomunidad.com/).
Repositorio del Portal Web de [Scrum Latam Comunidad](https://www.scrumlatamcomunidad.com/).

[English](README.md)

Expand All @@ -10,7 +10,7 @@ Repositorio del Sitio Web de [Scrum Latam Comunidad](https://www.scrumlatamcomun
[![Pruebas Frontend](https://github.com/ScrumLATAMComunidad/scrumlatamcomunidad.com/actions/workflows/frontend.yml/badge.svg)](https://github.com/ScrumLATAMComunidad/scrumlatamcomunidad.com/actions/workflows/frontend.yml)
[![Todos los colaboradores](https://img.shields.io/github/all-contributors/ScrumLATAMComunidad/scrumlatamcomunidad.com?color=ee8449&style=flat-square)](#contributors)

El nuevo sitio Web de SCRUM LATAM Comunidad usa tecnologías
El nuevo portal Web de SCRUM LATAM Comunidad usa tecnologías
Plone 6 y Volto.

## Inicio rápido
Expand Down Expand Up @@ -120,17 +120,17 @@ Este repositorio monolítico por dos bases de código distintas: api
(backend) y frontend.

- **backend**: Instalación de API (Backend) Plone usando `pip` (no
*buildout*). Incluye un paquete de políticas denominado `slc_sitioweb`. Más
*buildout*). Incluye un paquete de políticas denominado `slc_web`. Más
información detallada en el archivo
[backend/src/slc\_sitioweb/README.md](backend/src/slc_sitioweb/README.md).
[backend/src/slc\_web](backend/src/slc_web/README.md).
- **devops**: Scripts de despliegues Devops para este repositorio monolítico. Más
información detallada en el archivo [devops/README.md](devops/README.md).
- **frontend**: Paquete React (Volto) llamado frontend. Más información detallada
en el archivo [frontend/README.md](frontend/README.md).

### Razonamiento

- El repositorio contiene todo el código base necesario para ejecutar el sitio
- El repositorio contiene todo el código base necesario para ejecutar el portal
(excluyendo complementos existentes para Plone y React).
- Los flujos de trabajo de Github se activan en función de los cambios en cada base de código
(ver el directorio `.github/workflows`)
Expand Down
2 changes: 1 addition & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ lib64/
local/
node_modules/
parts/
src/slc_sitioweb/setuphandlers/data/*.json
src/slc_web/setuphandlers/data/*.json
dist/*
test.plone_addon/
var/
Expand Down
4 changes: 2 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ EOT
FROM plone/server-prod-config:${PLONE_VERSION}

LABEL maintainer="Leonardo J. Caballero G. <[email protected]>" \
org.label-schema.name="slc-sitioweb-backend" \
org.label-schema.description="SCRUM LATAM Comunidad Website backend image." \
org.label-schema.name="slc-web-backend" \
org.label-schema.description="SCRUM LATAM Comunidad Web portal backend image." \
org.label-schema.vendor="Leonardo J. Caballero G."

# Copy /app from builder
Expand Down
8 changes: 4 additions & 4 deletions backend/Dockerfile.acceptance
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ EOT
FROM plone/server-acceptance:${PLONE_VERSION}

LABEL maintainer="Leonardo J. Caballero G. <[email protected]>" \
org.label-schema.name="slc-sitioweb-acceptance" \
org.label-schema.description="SCRUM LATAM Comunidad Website backend acceptance image." \
org.label-schema.name="slc-web-acceptance" \
org.label-schema.description="SCRUM LATAM Comunidad Web portal backend acceptance image." \
org.label-schema.vendor="Leonardo J. Caballero G."

ENV CONFIGURE_PACKAGES="plone.restapi,plone.volto,plone.volto.cors,slc_sitioweb"
ENV APPLY_PROFILES="slc_sitioweb:default"
ENV CONFIGURE_PACKAGES="plone.restapi,plone.volto,plone.volto.cors,slc_web"
ENV APPLY_PROFILES="slc_web:default"

# Copy /app from builder
COPY --from=builder /app /app
Expand Down
6 changes: 3 additions & 3 deletions backend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ USER_INFO=$$(id -u ${CURRENT_USER})
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=ScrumLATAMComunidad/slc-sitioweb-backend
IMAGE_NAME=ScrumLATAMComunidad/slc-web-backend
IMAGE_TAG=latest

# Python checks
Expand Down Expand Up @@ -143,11 +143,11 @@ lint-zpretty: ## validate ZCML/XML using zpretty

.PHONY: test
test: ## run tests
./bin/zope-testrunner --auto-color --auto-progress --test-path src/slc_sitioweb/src/
./bin/zope-testrunner --auto-color --auto-progress --test-path src/slc_web/src/

.PHONY: test_quiet
test_quiet: ## run tests removing deprecation warnings
PYTHONWARNINGS=ignore ./bin/zope-testrunner --auto-color --auto-progress --test-path src/slc_sitioweb/src/
PYTHONWARNINGS=ignore ./bin/zope-testrunner --auto-color --auto-progress --test-path src/slc_web/src/

.PHONY: create-site
create-site: instance/etc/zope.ini ## Create a new site from scratch
Expand Down
2 changes: 1 addition & 1 deletion backend/instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ default_context:
initial_user_password: 'admin'

load_zcml:
package_includes: ['slc_sitioweb', 'pas.plugins.authomatic']
package_includes: ['slc_web', 'pas.plugins.authomatic']

db_storage: direct
4 changes: 2 additions & 2 deletions backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ pyflakes = ["+*"]
"flake8-*" = ["+*"]

[tool.plone-code-analysis]
paths = "src/slc_sitioweb/setup.py src/slc_sitioweb/src/ scripts/"
paths_pyroma = "src/slc_sitioweb"
paths = "src/slc_web/setup.py src/slc_web/src/ scripts/"
paths_pyroma = "src/slc_web"
2 changes: 1 addition & 1 deletion backend/requirements-docker.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
-c constraints.txt
src/slc_sitioweb
src/slc_web
4 changes: 2 additions & 2 deletions backend/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-c constraints.txt
-e src/slc_sitioweb[test]
-e src/slc_web[test]

zope.testrunner

# Add required add-ons
# (Ideally add them in setup.py for slc_sitioweb)
# (Ideally add them in setup.py for slc_web)
# collective.easyform
pas.plugins.authomatic @ git+https://github.com/collective/pas.plugins.authomatic@main
10 changes: 5 additions & 5 deletions backend/scripts/create_site.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from AccessControl.SecurityManagement import newSecurityManager
from Products.CMFPlone.factory import _DEFAULT_PROFILE
from Products.CMFPlone.factory import addPloneSite
from slc_sitioweb.interfaces import ISLC_SITIOWEBLayer
from slc_web.interfaces import ISLC_WEBLayer
from Testing.makerequest import makerequest
from zope.interface import directlyProvidedBy
from zope.interface import directlyProvides
Expand Down Expand Up @@ -32,7 +32,7 @@ def asbool(s):
request = app.REQUEST

ifaces = [
ISLC_SITIOWEBLayer,
ISLC_WEBLayer,
] + list(directlyProvidedBy(request))

directlyProvides(request, *ifaces)
Expand All @@ -43,11 +43,11 @@ def asbool(s):

site_id = "Plone"
payload = {
"title": "Sitio web de SCRUM LATAM Comunidad",
"title": "Portal web de SCRUM LATAM Comunidad",
"profile_id": _DEFAULT_PROFILE,
"extension_ids": [
"slc_sitioweb:default",
"slc_sitioweb:initial",
"slc_web:default",
"slc_web:initial",
],
"setup_content": False,
"default_language": "es",
Expand Down

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
slc_sitioweb Copyright 2023, SCRUM LATAM Comunidad
slc_web Copyright 2023, Leonardo J. Caballero G., SCRUM LATAM Comunidad

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
graft src/slc_sitioweb
graft src/slc_web
graft docs
include *.rst
include *.md
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# slc_sitioweb
# slc_web

A new SCRUM LATAM Comunidad Website using Plone 6 and Volto technologies.
A new SCRUM LATAM Comunidad Web portal using Plone 6 and Volto technologies.

## Features

Expand All @@ -15,10 +15,10 @@ This package contains a simple volto configuration.
Installation
------------

Install slc_sitioweb with `pip`:
Install `slc_web` with `pip`:

```shell
pip install slc_sitioweb
pip install slc_web
```

And to create the Plone site with default content structure, if exists
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Installer for the slc_sitioweb package."""
"""Installer for the slc_web package."""
from pathlib import Path
from setuptools import find_packages
from setuptools import setup
Expand All @@ -12,9 +12,9 @@


setup(
name="slc_sitioweb",
name="slc_web",
version="1.0.0a1",
description="SCRUM LATAM Comunidad Website configuration package.",
description="SCRUM LATAM Comunidad Web portal configuration package.",
long_description=long_description,
classifiers=[
"Environment :: Web Environment",
Expand All @@ -34,7 +34,7 @@
author_email="[email protected]",
url="https://github.com/ScrumLATAMComunidad/scrumlatamcomunidad.com",
project_urls={
"PyPI": "https://pypi.python.org/pypi/slc_sitioweb",
"PyPI": "https://pypi.python.org/pypi/slc_web",
"Source": "https://github.com/ScrumLATAMComunidad/scrumlatamcomunidad.com",
"Tracker": "https://github.com/ScrumLATAMComunidad/slc-sitioweb/issues",
},
Expand Down Expand Up @@ -64,6 +64,6 @@
[z3c.autoinclude.plugin]
target = plone
[console_scripts]
update_locale = slc_sitioweb.locales.update:update_locale
update_locale = slc_web.locales.update:update_locale
""",
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
import logging


_ = MessageFactory("slc_sitioweb")
_ = MessageFactory("slc_web")

logger = logging.getLogger("slc_sitioweb")
logger = logging.getLogger("slc_web")
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
xmlns:plone="http://namespaces.plone.org/plone"
i18n_domain="slc_sitioweb"
i18n_domain="slc_web"
>

<!-- Publish static files -->
<plone:static
directory="static"
name="slc_sitioweb"
name="slc_web"
type="plone"
/>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:i18n="http://namespaces.zope.org/i18n"
i18n_domain="slc_sitioweb"
i18n_domain="slc_web"
>

<i18n:registerTranslations directory="locales" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
from zope.publisher.interfaces.browser import IDefaultBrowserLayer


class ISLC_SITIOWEBLayer(IDefaultBrowserLayer):
class ISLC_WEBLayer(IDefaultBrowserLayer):
"""Marker interface that defines a browser layer."""
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


PATTERN = r"^[a-z]{2}.*"
domains = ("slc_sitioweb",)
domains = ("slc_web",)
cwd = Path.cwd()
target_path = Path(__file__).parent.parent.resolve()
locale_path = target_path / "locales"
Expand Down
Loading

0 comments on commit ae1e6a1

Please sign in to comment.