Create a new Project – Plone Deployment

Create a new Project#

As highlighted in the Introduction's Training Choices, GitHub is essential for building Docker images automatically in this training. The steps can be adapted for other providers like GitLab.

Generating the Codebase#

Execute Cookieplone to generate a Plone project skeleton with the command below.

pipx run cookieplone project

Answer the prompts as they appear. You can either accept the default values or enter your own.

Warning

For participants in Plone Conference 2024, please use the following settings:

  • Project Title: Plone Conference Training

  • Project Slug: ploneconf2024

  • Project URL: ploneconf2024-<your-github-username>.tangrama.com.br

  • GitHub Username or Organization: <your-github-username>

An example interaction with the Cookieplone wizard is shown below:

  [1/17] Project Title (Project Title): Plone Conference Training
  [2/17] Project Description (A new project using Plone 6.):
  [3/17] Project Slug (Used for repository id) (plone-conference-training): ploneconf2024
  [4/17] Project URL (without protocol) (ploneconf2024.example.com): ploneconf2024-<your-github-username>.tangrama.com.br
  [5/17] Author (Plone Foundation): <Your Name>
  [6/17] Author E-mail (foo@plone.org): <Your Email>
  [7/17] Should we use prerelease versions? (No):
  [8/17] Plone Version (6.0.13):
  [9/17] Volto Version (18.1.1):
  [10/17] Python Package Name (ploneconf2024):
  [11/17] Volto Addon Name (volto-ploneconf2024):
  [12/17] Language
    1 - English
    2 - Deutsch
    3 - Español
    4 - Português (Brasil)
    5 - Nederlands
    6 - Suomi
    Choose from [1/2/3/4/5/6] (1): 1
  [13/17] GitHub or GitLab Username or Organization (collective): <your-github-username>
  [14/17] Container Registry
    1 - GitHub Container Registry
    2 - Docker Hub
    3 - GitLab
    Choose from [1/2/3] (1): 1
  [15/17] Should we setup a caching server?
    1 - Yes
    2 - No
    Choose from [1/2] (1): 1
  [16/17] Add Ansible playbooks?
    1 - Yes
    2 - No
    Choose from [1/2] (1): 1
  [17/17] Add GitHub Action to Deploy this project?
    1 - Yes
    2 - No
    Choose from [1/2] (1): 1

Navigate to your project directory:

cd ploneconf2024

Understanding the Codebase#

  • /.github/workflows: Contains GitHub Actions workflows for code testing and container image release.

  • /backend: Holds the backend (API) solution with Python codebase located in src/plone_conference.

  • /frontend: Contains the frontend (Volto) solution generated by @plone/generator-volto.

  • /devops: Stores Ansible and Docker Stacks.

  • /Makefile: Defines tasks for codebase management.

We employ make for its reliability, widespread availability, and maturity. Future plans include enhancing make's dependency management and capabilities.

View all available commands and descriptions with:

make help

Installing the Codebase and Dependencies#

Install both the Plone backend and frontend with:

make install

This process will take a few minutes. Once completed, a success message will appear.

Code Formatting and i18n#

Ensure all tests pass on GitHub Actions after pushing the repository by running:

make check

Create a Repository on GitHub#

1. Login to GitHub#

Visit GitHub and log in.

2. Create a New Repository#

Click the '+' icon in the upper right corner, select 'New repository', and fill in the details:

  • Repository name: ploneconf2024

  • Description: Plone Conference 2024 Training

  • Visibility: Public

Click 'Create repository'.

Initialize and Push to the Git Repository#

1. Initialize Git#

Initializes a new Git repository and begins tracking an existing directory.

git init .

2. Add Files#

stages changes for commit, meaning it tracks the new files (in this case, all files in the directory with .). Staging lets you select which changes you want to commit.

git add .

3. Initial Commit#

Saves the staged changes along with a brief log message describing the changes. Replace "Initial commit" with a descriptive message if needed. It's the first commit, so we typically label it as the "Initial commit."

git commit -m "Initial commit"

5. Push to GitHub#

Push your commits to the remote repository hosted on GitHub. This command will trigger the GitHub Actions that test the codebase and generate Docker images for the Backend and for the Frontend.

git push -u origin main