Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: track introduction of env/setenv.sh in #9854 #9998

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/dev/how-to-develop-producer-platform.md
Expand Up @@ -4,15 +4,15 @@ Here is how to develop for the producers platform using docker.

### Prerequisites:

- Docker should already be [set up for development.](how-to-quick-start-guide.md).
- Docker should already be [set up for development](how-to-quick-start-guide.md).

### Shell Setup:
You will need two types of shells:
- Shell for OpenFoodFacts:
- Use this shell for general development on the OpenFoodFacts platform.
- Shell for OpenFoodFacts-Pro: Use this shell when working on the OpenFoodFacts-Pro platform.
- To set up the shell, source the `setenv-pro.sh` file by running the command: `. setenv-pro.sh`.
- Once the shell is set up, your prompt will show `(pro)` to indicate that you are in the producers environment.(this simply sets some environment variables that will overides the one in `.env`)
- To set up the shell, run the command: `. env/setenv.sh off-pro` (this simply sets some environment variables that will override the ones in `.env`).
- Once the shell is set up, your prompt will show `(pro)` to indicate that you are in the producers environment.

### Development Workflow:
To develop on the producers platform, follow these steps:
Expand All @@ -27,24 +27,24 @@ If you need to work on product import/export or interact with the public platfor
- In a *non-pro* shell (OpenFoodFacts shell), run the command `docker compose up postgres minion mongodb`.
- This command starts the necessary services in the background.

#### Note: The setup does not currently support running the http server for both public and pro platform at the same simultaneously. Therefore, to access the public platform, you need to follow these steps:
#### Note: The setup does not currently support running the http server for both public and pro platform at the same time. Therefore, to access the public platform, you need to follow these steps:

- in your *pro shell*, run a `docker compose stop frontend`
- in your *non pro shell*, run a `docker compose up frontend`
Now, the public database can be accessed at `openfoodfacts.localhost`.If you need to access the *pro* HTTP server, reverse these steps.

Note that if you [use direnv](how-to-use-direnv.md), the setup should work seamlessly without redefining the variables set by `setenv-pro.sh`.
Note that if you [use direnv](how-to-use-direnv.md), the setup should work seamlessly without redefining the variables set by `setenv.sh`.

An explanation of the setup can be found at [explain-pro-dev-setup.md](explain-pro-dev-setup.md)

- If you want to see state of tasks, you can run:
- If you want to see the state of tasks, you can run:

```
docker compose exec minion /opt/product-opener/scripts/minion_producers.pl minion job
```
(add --help to see all options), or refer to https://docs.mojolicious.org/Minion/Command/minion/job

- You may also inspect database by running:
- You may also inspect the database by running:
```
docker compose exec postgres psql -U productopener -W minion
```
Expand Down