Name | stb-mnt JSON |
Version |
4.9.1
JSON |
| download |
home_page | |
Summary | A universal tool for local microservice management. |
upload_time | 2023-12-06 12:21:51 |
maintainer | |
docs_url | None |
author | Stanislav Zmiev |
requires_python | >=3.8,<4.0 |
license | |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# stb
A universal tool for local microservice management
## Requirements
* [Poetry](https://python-poetry.org/) - Required for setup functionality
* [Pyenv](https://github.com/pyenv/pyenv) - Optional
## Installation
```bash
pipx install stb-mnt
```
## Usage
### Setup
* To download and setup my_company/backend/service1 microservice as a subdirectory to the current working directory, use:
```bash
stb setup my_company/backend/service1
```
* To download and setup my_company/backend/service1 and my_company/backend/service2 as subdirectories to current working directory, use:
```bash
stb setup my_company/backend/service1 my_company/backend/service2
```
* To setup all backend services, use:
```bash
stb setup my_company/backend
```
Note that if you want to clone repositories, you must first set a `git_url` using `stb config set git_url` command
### Update
* To update .env file in accordance with .env.example in a microservice:
```bash
stb update env
```
* To synchronize service ports between all installed microservices (you can specify which ones will run locally with the `--local` option):
```bash
stb update ports
```
* To update poetry.lock file, install dependencies, stash current changes, checkout to master, pull from remote, and recreate databases:
```bash
stb update package -piucd
```
or
```bash
stb update package --pull --update --checkout --reset-databases
```
### DB
* To upgrade migrations in a microservice:
```bash
stb db upgrade
```
* To create databases and upgrade its migrations in a microservice:
```bash
stb db create
```
* To drop databases in a microservice:
```bash
stb db drop
```
* To drop and recreate databases, and upgrade migrations in a microservice:
```bash
stb db reset
```
* To upgrade migrations in parallel for faster upgrades (useful for large monoliths with multiple databases), you can use the -p (--parallel) option:
```bash
stb db create -p
```
```bash
stb db reset -p
```
* To force dropping of databases in case another program is using them at the same time, you can use the -f (--force) option:
```bash
stb db drop -f
```
```bash
stb db reset -f
```
### Use
`stb use` allows you to take a company private package and install either a cloud version or a local version of it. STB will preserve all extras, automatically set package source, and will gracefully handle any issues that might happen while updating.
* To install a local version of `my_package` that is located at `../my_package`:
```bash
stb use ../my_package
```
* To install a local version of `my_package` that is located at `../my_package` in editable mode:
```bash
stb use ../my_package --editable
```
* To install a cloud version of `my_package` with tag `8.3.1`:
```bash
stb use "my_package==8.3.1"
```
* To install a cloud version of my_package with tag `8.3.1`, my_other_package with any tag higher than `1.2.3`, and my_third_package with any tag more than or equal to `4.5.6` and less than `5.0.0`:
```bash
stb use "my_package==8.3.1" "my_other_package>1.2.3" "my_third_package^4.5.6"
```
### Run
* To update and run the select services concurrently:
```bash
stb run service1 service2
```
### Config
* To set a git url for cloning:
```bash
stb config set git_url git@gitlab.my_company.com
```
### Graph
* To get a dependency graph of your microservices:
```bash
stb graph json my_company/backend/ my_company/infrastructure/
```
* To get a dependency graph of your microservices as an svg image (requires graphviz):
```bash
stb graph graphviz my_company/backend/ my_company/infrastructure/
```
In both commands above, you can use the `-i` argument to omit some packages and links to them from your graph. For example:
```bash
stb graph json my_company/backend/ my_company/infrastructure/ -i my_internal_package -i my_other_package
```
### How directories are selected for update/db
For every update, you can specify:
1) A microservice directory, which will cause stb to update only that microservice
2) Several microservice directories, which will cause stb to update these microservices and integrate them together (for example, `update ports` assigns ports to local microservices and updates their links in other microservices to match the assigned ports)
3) A directory with multiple microservice subdirectories inside it, which is equivalent to (2) with the list of subdirectories as arguments
4) Nothing, which will choose the current working directory as the first argument and will be equivalent to (1) or (3)
Raw data
{
"_id": null,
"home_page": "",
"name": "stb-mnt",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Stanislav Zmiev",
"author_email": "zmievsa@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/a4/f4/0c0b47666b3820d1b26658474e593a22f946fe215b257b7f8a0fcfadbc6e/stb_mnt-4.9.1.tar.gz",
"platform": null,
"description": "# stb\n\nA universal tool for local microservice management\n\n## Requirements\n\n* [Poetry](https://python-poetry.org/) - Required for setup functionality\n* [Pyenv](https://github.com/pyenv/pyenv) - Optional\n\n## Installation\n\n```bash\npipx install stb-mnt\n```\n\n## Usage\n\n### Setup\n\n* To download and setup my_company/backend/service1 microservice as a subdirectory to the current working directory, use:\n\n```bash\nstb setup my_company/backend/service1\n```\n\n* To download and setup my_company/backend/service1 and my_company/backend/service2 as subdirectories to current working directory, use:\n\n```bash\nstb setup my_company/backend/service1 my_company/backend/service2\n```\n\n* To setup all backend services, use:\n\n```bash\nstb setup my_company/backend\n```\n\nNote that if you want to clone repositories, you must first set a `git_url` using `stb config set git_url` command\n\n### Update\n\n* To update .env file in accordance with .env.example in a microservice:\n\n```bash\nstb update env\n```\n\n* To synchronize service ports between all installed microservices (you can specify which ones will run locally with the `--local` option):\n\n```bash\nstb update ports\n```\n\n* To update poetry.lock file, install dependencies, stash current changes, checkout to master, pull from remote, and recreate databases:\n\n```bash\nstb update package -piucd\n```\n\nor \n\n```bash\nstb update package --pull --update --checkout --reset-databases\n```\n\n### DB\n\n* To upgrade migrations in a microservice:\n\n```bash\nstb db upgrade\n```\n\n* To create databases and upgrade its migrations in a microservice:\n\n```bash\nstb db create\n```\n\n* To drop databases in a microservice:\n\n```bash\nstb db drop\n```\n\n* To drop and recreate databases, and upgrade migrations in a microservice:\n\n```bash\nstb db reset\n```\n\n* To upgrade migrations in parallel for faster upgrades (useful for large monoliths with multiple databases), you can use the -p (--parallel) option:\n\n```bash\nstb db create -p\n```\n \n```bash\nstb db reset -p\n```\n \n* To force dropping of databases in case another program is using them at the same time, you can use the -f (--force) option:\n\n```bash\nstb db drop -f\n```\n \n```bash\nstb db reset -f\n```\n \n### Use\n\n`stb use` allows you to take a company private package and install either a cloud version or a local version of it. STB will preserve all extras, automatically set package source, and will gracefully handle any issues that might happen while updating.\n\n* To install a local version of `my_package` that is located at `../my_package`:\n\n```bash\nstb use ../my_package\n```\n\n* To install a local version of `my_package` that is located at `../my_package` in editable mode:\n\n```bash\nstb use ../my_package --editable\n```\n\n* To install a cloud version of `my_package` with tag `8.3.1`:\n\n```bash\nstb use \"my_package==8.3.1\"\n```\n\n* To install a cloud version of my_package with tag `8.3.1`, my_other_package with any tag higher than `1.2.3`, and my_third_package with any tag more than or equal to `4.5.6` and less than `5.0.0`:\n\n```bash\nstb use \"my_package==8.3.1\" \"my_other_package>1.2.3\" \"my_third_package^4.5.6\"\n```\n\n### Run\n\n* To update and run the select services concurrently:\n\n```bash\nstb run service1 service2\n```\n\n### Config\n\n* To set a git url for cloning:\n\n```bash\nstb config set git_url git@gitlab.my_company.com\n```\n\n### Graph\n\n* To get a dependency graph of your microservices:\n\n```bash\nstb graph json my_company/backend/ my_company/infrastructure/\n```\n\n* To get a dependency graph of your microservices as an svg image (requires graphviz):\n\n```bash\nstb graph graphviz my_company/backend/ my_company/infrastructure/\n```\n\nIn both commands above, you can use the `-i` argument to omit some packages and links to them from your graph. For example:\n\n```bash\nstb graph json my_company/backend/ my_company/infrastructure/ -i my_internal_package -i my_other_package\n```\n\n### How directories are selected for update/db\n\nFor every update, you can specify:\n\n1) A microservice directory, which will cause stb to update only that microservice\n2) Several microservice directories, which will cause stb to update these microservices and integrate them together (for example, `update ports` assigns ports to local microservices and updates their links in other microservices to match the assigned ports)\n3) A directory with multiple microservice subdirectories inside it, which is equivalent to (2) with the list of subdirectories as arguments\n4) Nothing, which will choose the current working directory as the first argument and will be equivalent to (1) or (3)\n",
"bugtrack_url": null,
"license": "",
"summary": "A universal tool for local microservice management.",
"version": "4.9.1",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "884035d66f0511a1ad8d04caac5149d7eee313370d44e0e74204189eb96dc785",
"md5": "38dc3478ab750241b11a02c0c0ea8462",
"sha256": "d5b3d2af0bc9caa4e83038068e7e7772bd1d508e0b17404674d3690eb7e9a7f4"
},
"downloads": -1,
"filename": "stb_mnt-4.9.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "38dc3478ab750241b11a02c0c0ea8462",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 22250,
"upload_time": "2023-12-06T12:21:49",
"upload_time_iso_8601": "2023-12-06T12:21:49.105996Z",
"url": "https://files.pythonhosted.org/packages/88/40/35d66f0511a1ad8d04caac5149d7eee313370d44e0e74204189eb96dc785/stb_mnt-4.9.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a4f40c0b47666b3820d1b26658474e593a22f946fe215b257b7f8a0fcfadbc6e",
"md5": "46bef6eba7b804770ab60dd220199394",
"sha256": "e7cbda6cce007db0bdccb7e6a31d906bc864f9e3e098d43f709572a1fe091c05"
},
"downloads": -1,
"filename": "stb_mnt-4.9.1.tar.gz",
"has_sig": false,
"md5_digest": "46bef6eba7b804770ab60dd220199394",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 19893,
"upload_time": "2023-12-06T12:21:51",
"upload_time_iso_8601": "2023-12-06T12:21:51.553513Z",
"url": "https://files.pythonhosted.org/packages/a4/f4/0c0b47666b3820d1b26658474e593a22f946fe215b257b7f8a0fcfadbc6e/stb_mnt-4.9.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-06 12:21:51",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "stb-mnt"
}