Skip to content

Commit dfaf5b9

Browse files
committed
Add section process manage.
and some more content
1 parent cfc8cda commit dfaf5b9

File tree

2 files changed

+73
-16
lines changed

2 files changed

+73
-16
lines changed

docs/install/source-step-by-step.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,14 @@ You can stop the instance later with {kbd}`ctrl-esc`.
121121

122122
If you now open the browser with http://localhost:8080/, you see that you already can create a Plone instance.
123123
Before doing this, we configure our Zope instance for blobs, configure add-ons, etc..
124+
124125
For the configuration, you have two options:
125126
- manual configuration of site.zcml and zope.conf (^[Configuring and Running Zope](https://zope.readthedocs.io/en/latest/operation.html))
126127
- apply `cookiecutter-zope-instance`
127128

128129
(install-source-cookiecutter-zope-instance-label)=
129130

130-
#### Cookiecutter Zope instance
131+
#### Generate Plone / Zope configuration with cookiecutter
131132

132133
`Cookiecutter` creates projects from project templates.
133134
{term}`cookiecutter-zope-instance` is such a template that allows to create a complete Zope configuration. Zope configuration means: blob storage, type of file storage (Zope style or relational database), ZEO, you name it.
@@ -165,7 +166,7 @@ Find more [options of cookiecutter `cookiecutter-zope-instance`](https://github.
165166
The file {file}`instance.yaml` allows to set some presets.
166167
Add-ons are listed here, but need to be installed with pip.
167168
The documented installation of add-ons with pip is achieved via a {file}`requirements.txt` file.
168-
An add-on like for example `collective.easyform` is listed in\
169+
We list an add-on like for example `collective.easyform` in\
169170
`requirements.txt`:
170171

171172
```
@@ -180,7 +181,7 @@ pip install -r requirements.txt
180181

181182
You have done two things so far: You installed your add-on packages and you have prepared an initializing file to roll out a Zope / Plone project, configured to load your installed add-on packages.
182183

183-
You are now ready to apply your cookiecutter:
184+
You are now ready to apply `cookiecutter`to generate the Zope configuration:
184185

185186
```shell
186187
cookiecutter -f --no-input --config-file instance.yaml https://github.com/plone/cookiecutter-zope-instance
@@ -288,7 +289,7 @@ extras = test
288289

289290
A run of mxdev reads {file}`requirements.txt`, {file}`constraints.txt` and {file}`mx.ini`, and writes new combined requirements in {file}`requirements-mxdev.txt` and writes new constraints in {file}`constraints-mxdev.txt` according to {file}`mx.ini`:
290291

291-
- 'version-overrides' in [settings]
292+
- 'version-overrides' in section [settings]
292293
- checkout settings in [packagename] sections
293294

294295

@@ -311,9 +312,10 @@ Create
311312
```
312313
````
313314

314-
So with the three files above, run `mxdev` with:
315+
So with the three files above, install and run `mxdev` with:
315316

316317
```shell
318+
pip install mxdev
317319
mxdev -c mx.ini
318320
```
319321

docs/install/source.md

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ short explanation of backend components and how they interact
4646
- Plone instance
4747
- {term}`WSGI`
4848
- REST API
49+
50+
Application server {term}`Zope` is working hard. {term}`Plone` provides the CMS stuff. {term}`WSGI` fills the gap between Python app Zope and web server. {term}`REST API` is the interface to request the Plone backend from thin air. The frontend {term}`Volto` does request this interface. Voilà.
4951
```
5052

5153

@@ -78,7 +80,7 @@ You are probably familiar with a `buildout` Plone installation. The installation
7880

7981
### Installation – jump in and enfold the beauty
8082

81-
```{note}
83+
```{important}
8284
There will be one single cookiecutter template to install both backend and frontend.
8385
By now the chapter {ref}`install-source-stepbystep-start-label` is for you.
8486
It explains the installation of the backend with `pip`.
@@ -150,7 +152,9 @@ Instead we customize the setting with additional add-ons and constraints of a Pl
150152

151153
### Tasks on your backend installation from scratch
152154

153-
Adding an add-on
155+
You have installed Plone with `pip` like explained above or in {ref}`install-source-stepbystep-start-label`.
156+
157+
Add an add-on
154158
: Add a line with the name of your add-on to `requirements.txt` and add it to {ref}`instance.yaml<install-source-cookiecutter-zope-instance-presets-label>`, then install with pip and apply cookiecutter:
155159

156160
{file}`requirements.txt`:
@@ -173,7 +177,7 @@ Adding an add-on
173177
pip install -r requirements-mxdev.txt
174178
```
175179

176-
Pin version of an add-on
180+
Pin the version of an add-on
177181
: Pin the version in {file}`constraints.txt`:
178182

179183
```
@@ -204,13 +208,7 @@ Pin version of an add-on
204208

205209

206210
Checkout an add-on
207-
: Configure the repository address and branch in {file}`constraints.txt`:
208-
209-
```
210-
collective.bookmarks @ https://github.com/collective/collective.bookmarks/archive/refs/heads/master.zip
211-
```
212-
213-
Add the add-on to {file}`requirements.txt`:
211+
: Add the add-on to {file}`requirements.txt`:
214212

215213
```
216214
collective.bookmarks
@@ -244,7 +242,7 @@ Checkout an add-on
244242

245243

246244

247-
Pin version of a Plone package / constraints
245+
Pin the version of a Plone package / constraints
248246
: A version can **not** be pinned in constraints.txt if the package is mentionend in the constraints of Plone.
249247
Any other package version could be pinned in constraints.txt.
250248
A summary of section {ref}`install-source-checkout-and-pin` for a clean and well documented set up of your Zope/Plone installation:
@@ -301,6 +299,8 @@ Build and start your instance
301299

302300
Head over to http://localhost:8080/ and see that Plone is running.
303301

302+
Your instance is running in foreground. For a deamon, see section {ref}`install-source-process-manger`.
303+
304304

305305
(install-source-deprecated-label)=
306306

@@ -502,6 +502,61 @@ Welcome to Plone 6!
502502
<!-- TODO I have now my local environment with add-ons. How do I deploy? -->
503503
504504
505+
(install-source-process-manger)=
506+
507+
## Process manager (he/she/you)
508+
509+
Run, stop, restart your backend and frontend and more with one command. In the background, for production. Get to know process manager {term}`pm2`!
510+
511+
512+
Create an overall process configuration file {file}`pm2.config.js`:
513+
514+
```js
515+
let apps = [
516+
{
517+
name : "plone_backend_tutorial",
518+
script: 'runwsgi instance/etc/zope.ini',
519+
cwd: 'backend'
520+
},
521+
{
522+
name : "plone_frontend_tutorial",
523+
script: 'yarn build && yarn start:prod',
524+
cwd: 'frontend'
525+
}
526+
];
527+
528+
module.exports = { apps: apps };
529+
530+
```
531+
532+
Start all with:
533+
534+
```shell
535+
pm2 start pm2.config.js
536+
```
537+
538+
See processes managed by `pm2` (running and not running):
539+
540+
```shell
541+
pm2 l
542+
```
543+
544+
![List processes with 'pm2 l'](/_static/illustration/pm2.png)
545+
546+
Restart e.g. the backend process with:
547+
548+
```shell
549+
pm2 start plone_backend_tutorial
550+
```
551+
552+
Stop e.g. the backend process with:
553+
554+
```shell
555+
pm2 stop plone_backend_tutorial
556+
```
557+
558+
559+
505560
(install-source-tools-label)=
506561
507562
## Tools

0 commit comments

Comments
 (0)