Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/build_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ jobs:
url: https://docs.plone.org
steps:
- uses: actions/checkout@v5
with:
submodules: true
Comment on lines +19 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add this? It's not broken and it has nothing to do with the purpose of this PR. Please revert.

Suggested change
with:
submodules: true

- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v2
- name: Set up Python 3.12
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
submodules: true
Comment on lines +10 to +11
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you add this? It's not broken and it has nothing to do with the purpose of this PR. Please revert.

Suggested change
with:
submodules: true


- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
Expand Down
17 changes: 14 additions & 3 deletions docs/developer-guide/create-a-distribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,16 @@ As an example, the configuration for a new Plone site with Volto as its frontend
"plonetheme.barceloneta:default",
"plone.volto:default"
],
"content": [
"plone.volto:default-homepage"
]
"content": []
}
```

```{note}
The `plone.volto:default-homepage` profile was removed from `plone.volto` in version 5.
For creating example content, use the `content` folder with exported content instead of profiles.
See the {ref}`add-example-content-label` section below for details.
```


### `schema.json`

Expand Down Expand Up @@ -319,6 +323,8 @@ Finally, add it to your {file}`profiles.json` file.
```


(add-example-content-label)=

## Add example content

The distribution loads its content from JSON data in the `content` folder.
Expand All @@ -331,6 +337,11 @@ bin/export-distribution path/to/zope.conf Plone

In the example above, `Plone` is the ID of the Plone site to export.

```{note}
This is the recommended approach for creating example content in distributions.
The old approach of using profiles like `plone.volto:default-homepage` has been deprecated and removed from `plone.volto` in version 5.
Comment on lines +340 to +342
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davisagli can I get a confirmation about this change?

Suggested change
```{note}
This is the recommended approach for creating example content in distributions.
The old approach of using profiles like `plone.volto:default-homepage` has been deprecated and removed from `plone.volto` in version 5.
```{versionremoved} `plone.volto` 5.0.0b1
This is the recommended approach for creating example content in distributions.
The old approach of using profiles like `plone.volto:default-homepage` has been deprecated and removed from [`plone.volto` in version 5.0.0b1](https://github.com/plone/plone.volto/blob/main/CHANGES.md#500b1-2024-10-30).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevepiercy It is correct that the plone.volto:default-homepage profile was removed from plone.volto, but I think it's noise to mention that here. These docs are for someone creating a new distribution, not someone who is updating an existing distribution that might have referenced that profile.

It's incorrect to say that the old approach of referencing content profiles in the distribution is deprecated. Both approaches for creating example content are still supported. It's fine to say that this one is the recommended one (since it requires less configuration).

I don't understand why any of this is in this particular pull request, which claims to be about adding documentation for an interactive shell, which is unrelated to distributions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a separate PR to clean up the outdated references to the plone.volto:default-homepage profile, so that we can focus on the interactive shell docs here.

```


## Limit available distributions

Expand Down
3 changes: 2 additions & 1 deletion docs/install/containers/images/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ services:
environment:
- SITE=Plone
- 'ADDONS=plone.restapi==8.21.0 plone.volto==4.0.0a3 plone.rest==2.0.0a2 plone.app.iterate==4.0.2 plone.app.vocabularies==4.3.0'
- 'PROFILES=plone.volto:default-homepage'
# Note: plone.volto:default-homepage profile was removed in version 5
# Use content export/import instead for example content
Comment on lines +111 to +112
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, wait a minute. The ADDONS includes plone.volto==4.0.0a3, and not 5.0.0b1 or later, making this comment very confusing. @davisagli @ericof @sneridagh @mauritsvanrees can I get some clarification on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a quite old list of version pins which was probably left over from Plone 5 where volto wasn't included. Neither the ADDONS nor PROFILES environment variables should be needed here; the plone-backend image already contains appropriate versions.


frontend:
image: 'myfrontend:latest'
Expand Down
86 changes: 86 additions & 0 deletions docs/install/containers/recipes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,89 @@ docker compose run backend pack
The above command assumes that the service that runs the Plone instance is named `backend`.
Otherwise replace `backend` with your container's name.


## Interactive shell for debugging

When developing or troubleshooting Plone applications in Docker containers, you may need an interactive Python shell with the Plone environment loaded.
This is the Docker equivalent of the `bin/instance debug` command used in traditional Plone installations.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are multiple traditions for how to install Plone. It'd be clearer to say buildout-based instead of traditional.

Note, we already have documentation for doing this outside the context of a Docker container in https://6.docs.plone.org/admin-guide/run-plone.html#run-a-debug-console where we call it a debug console rather than an interactive shell. I don't care what we call it but we should be consistent.


### Using docker exec
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Using docker exec
### `docker exec`


If you have a running Plone container, you can start an interactive shell using `docker exec`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you have a running Plone container, you can start an interactive shell using `docker exec`:
In a running Plone container, start an interactive shell using `docker exec` by substituting the name of your backend container for `BACKEND_CONTAINER_NAME` in the following command.


```shell
docker exec -it <container_name> /bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker exec -it <container_name> /bin/bash

Suggested change
docker exec -it <container_name> /bin/bash
docker exec -it BACKEND_CONTAINER_NAME /bin/bash

```

Once inside the container, you can start the Plone debug console:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Once inside the container, you can start the Plone debug console:
Once inside the container, start the Plone debug console.


```shell
bin/instance debug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there's a step missing before this one. I followed the instructions in https://6.docs.plone.org/install/containers/index.html through "Access your Plone site" to set up the containers. The bin directory has all the usual Plone stuff, but no instance.

docker exec -it plone6-backend /bin/bash
root@9ae16356b1a2:/app# bin/instance debug
bash: bin/instance: No such file or directory

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Within the plone-backend container, the correct command is ./docker-entrypoint.sh console, not bin/instance debug. bin/instance debug would only work with a buildout-based installation, which the plone-backend container does not use.

```

### Using docker run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Using docker run
### `docker run`


Alternatively, you can start a new container instance specifically for debugging:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Alternatively, you can start a new container instance specifically for debugging:
Alternatively, start a new container instance specifically for debugging.


```shell
docker run -it --rm plone/plone-backend:{PLONE_BACKEND_MINOR_VERSION} /bin/bash
```

Then start the debug console:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then start the debug console:
Then start the debug console.


```shell
bin/instance debug
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See previous comment. I have no bin/instance.

```

### Using Docker Compose
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Using Docker Compose
### `docker compose`


If you're using Docker Compose, you can run an interactive shell with:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
If you're using Docker Compose, you can run an interactive shell with:
With `docker compose`, run an interactive shell with the following command.


```shell
docker compose exec backend /bin/bash
```

Then start the debug console:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Then start the debug console:
Then start the debug console.


```shell
bin/instance debug
```

Or run it directly in one command:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Or run it directly in one command:
Or run it directly in one command.


```shell
docker compose exec backend bin/instance debug
```

### Accessing the Plone site
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Accessing the Plone site
### Access the Plone site


Once in the debug console, you can access your Plone site and perform debugging operations:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Once in the debug console, you can access your Plone site and perform debugging operations:
Once in the debug console, you can access your Plone site and perform debugging operations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This information isn't specific to a console that was started in a container. It should go under https://6.docs.plone.org/admin-guide/run-plone.html#run-a-debug-console instead.


```python
# Access the root application
app = self.app

# Access your Plone site (replace 'Plone' with your site ID)
site = app['Plone']

# Access content
folder = site['my-folder']
item = folder['my-item']
Comment on lines +235 to +240
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assume code uses Black formatting.

Suggested change
# Access your Plone site (replace 'Plone' with your site ID)
site = app['Plone']
# Access content
folder = site['my-folder']
item = folder['my-item']
# Access your Plone site (replace "Plone" with your site ID)
site = app["Plone"]
# Access content
folder = site["my-folder"]
item = folder["my-item"]


# Set up a fake request for testing
from Testing.makerequest import makerequest
from zope.globalrequest import setRequest

app = makerequest(app)
setRequest(app.REQUEST)
```

### Exiting the debug console
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Exiting the debug console
### Exit the debug console


To exit the debug console, use {kbd}`ctrl-d` or type `exit()`.

```{note}
The interactive shell provides full access to your Plone environment and database.
Use it carefully in production environments.
```