Skip to content

Commit

Permalink
docs: track introduction of env/setenv.sh in #9854 (#9998)
Browse files Browse the repository at this point in the history
While there:
- reorganize surrounding text for better flow
- light copyediting throughout
  • Loading branch information
pauamma committed Mar 24, 2024
1 parent 22f60d2 commit 8a8d842
Showing 1 changed file with 7 additions and 7 deletions.
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

0 comments on commit 8a8d842

Please sign in to comment.