2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 10:35:40 +00:00

Add namespaces to tasks (#7904)

* Namespaces for invoke tasks
Fixes #7852

* adjust various places that call re-namespaced tasks

* use full invoke command
easier for future refactors

* fix call name

* move worker to int

* adapt calls in tasks

* fix changed path

* ignore localhost links

* Avoid using internal names
This commit is contained in:
Matthias Mair
2024-09-05 05:04:57 +02:00
committed by GitHub
parent 690308d032
commit e3205184be
22 changed files with 112 additions and 58 deletions

View File

@ -22,10 +22,10 @@ The API is self-documenting, and the documentation is provided alongside any Inv
### Generating Schema File
If you want to generate the API schema file yourself (for example to use with an external client, use the `invoke schema` command. Run with the `-help` command to see available options.
If you want to generate the API schema file yourself (for example to use with an external client, use the `invoke dev.schema` command. Run with the `-help` command to see available options.
```
invoke schema -help
invoke dev.schema -help
```
## Authentication

View File

@ -52,7 +52,7 @@ invoke setup-dev
## Branches and Versioning
InvenTree roughly follow the [GitLab flow](https://docs.gitlab.com/ee/topics/gitlab_flow.html) branching style, to allow simple management of multiple tagged releases, short-lived branches, and development on the main branch.
InvenTree roughly follow the [GitLab flow](https://about.gitlab.com/topics/version-control/what-are-gitlab-flow-best-practices/) branching style, to allow simple management of multiple tagged releases, short-lived branches, and development on the main branch.
There are nominally 5 active branches:
- `master` - The main development branch

View File

@ -14,7 +14,7 @@ The React frontend requires its own packages that aren't installed via the usual
#### Docker
Run the following command:
`docker compose run inventree-dev-server invoke frontend-compile`
`docker compose run inventree-dev-server invoke int.frontend-compile`
This will install the required packages for running the React frontend on your InvenTree dev server.
#### Devcontainer
@ -24,14 +24,14 @@ This will install the required packages for running the React frontend on your I
Open a new terminal from the top menu by clicking `Terminal > New Terminal`
Make sure this terminal is running within the virtual env. The start of the last line should display `(venv)`
Run the command `invoke frontend-compile`. Wait for this to finish
Run the command `invoke int.frontend-compile`. Wait for this to finish
### Running
After finishing the install, you need to launch a frontend server to be able to view the new UI.
Using the previously described ways of running commands, execute the following:
`invoke frontend-dev` in your environment
`invoke dev.frontend-dev` in your environment
This command does not run as a background daemon, and will occupy the window it's ran in.
### Accessing
@ -40,7 +40,7 @@ When the frontend server is running, it will be available on port 5173.
i.e: https://localhost:5173/
!!! note "Backend Server"
The InvenTree backend server must also be running, for the frontend interface to have something to connect to! To launch a backend server, use the `invoke server` command.
The InvenTree backend server must also be running, for the frontend interface to have something to connect to! To launch a backend server, use the `invoke dev.server` command.
### Debugging

View File

@ -107,7 +107,7 @@ The background worker process must be started separately to the web-server appli
From the top-level source directory, run the following command from a separate terminal, while the server is already running:
```
invoke worker
invoke int.worker
```
!!! info "Supervisor"

View File

@ -17,7 +17,7 @@ InvenTree includes a simple server application, suitable for use in a developmen
To run the development server on a local machine, run the command:
```
(env) invoke server
(env) invoke dev.server
```
This will launch the InvenTree web interface at `http://127.0.0.1:8000`.
@ -25,7 +25,7 @@ This will launch the InvenTree web interface at `http://127.0.0.1:8000`.
A different port can be specified using the `-a` flag:
```
(env) invoke server -a 127.0.0.1:8123
(env) invoke dev.server -a 127.0.0.1:8123
```
Serving on the address `127.0.0.1` means that InvenTree will only be available *on that computer*. The server will be accessible from a web browser on the same computer, but not from any other computers on the local network.
@ -35,7 +35,7 @@ Serving on the address `127.0.0.1` means that InvenTree will only be available *
To enable access to the InvenTree server from other computers on a local network, you need to know the IP of the computer running the server. For example, if the server IP address is `192.168.120.1`:
```
(env) invoke server -a 192.168.120.1:8000
(env) invoke dev.server -a 192.168.120.1:8000
```
## Background Worker
@ -52,7 +52,7 @@ source ./env/bin/activate
### Start Background Worker
```
(env) invoke worker
(env) invoke int.worker
```
This will start the background process manager in the current shell.

View File

@ -202,7 +202,7 @@ Any persistent files generated by the Caddy container (such as certificates, etc
To quickly get started with a [demo dataset](../demo.md), you can run the following command:
```
docker compose run --rm inventree-server invoke setup-test -i
docker compose run --rm inventree-server invoke dev.setup-test -i
```
This will install the InvenTree demo dataset into your instance.
@ -210,7 +210,7 @@ This will install the InvenTree demo dataset into your instance.
To start afresh (and completely remove the existing database), run the following command:
```
docker compose run --rm inventree-server invoke delete-data
docker compose run --rm inventree-server invoke dev.delete-data
```
## Install custom packages
@ -247,7 +247,7 @@ index 8adee63..dc3993c 100644
- image: inventree/inventree:${INVENTREE_TAG:-stable}
+ image: inventree/inventree:${INVENTREE_TAG:-stable}-custom
+ pull_policy: never
command: invoke worker
command: invoke int.worker
depends_on:
- inventree-server
```

View File

@ -6,6 +6,9 @@
{
"pattern": "http://localhost"
},
{
"pattern": "https://localhost:5173/"
},
{
"pattern": "http://127.0.0.1"
},