Skip to main content

stb

A universal tool for local microservice management

Installation

pipx install stb-mnt

Usage

Setup

  • To download and setup backend/service1 microservice as a subdirectory to the current working directory, use:
stb setup backend/service1
  • To download and setup backend/service1 and backend/service2 as subdirectories to current working directory, use:
stb setup backend/service1 backend/service2
  • To setup backend/service1 that you have already cloned, use:
stb setup backend/service1 --no-clone

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:
stb update env
  • To synchronize service ports between all installed microservices (you can specify which ones will run locally with the --local option):
stb update ports
  • To install the dependencies from poetry.lock file and update submodules:
stb update package
  • To update poetry.lock file, install dependencies, update submodules, stash current changes, checkout to master, pull from remote, and recreate databases:
stb update package -pucd

or

stb update package --pull --update --checkout --reset-databases

DB

  • To upgrade migrations in a microservice:
stb db upgrade
  • To create databases and upgrade its migrations in a microservice:
stb db create
  • To drop databases in a microservice:
stb db drop
  • To drop and recreate databases, and upgrade migrations in a microservice:
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:
stb db create -p
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:
stb db drop -f
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 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:
stb use my_package ../my_package
  • To install a cloud version of my_package with tag 8.3.1:
stb use my_package 8.3.1

Run

  • To update and run the select services concurrently:
stb run service1 service2

Config

  • To set a git url for cloning:
stb config set git_url git@github.com:mycompany

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)

Metadata

Release files for stb-mnt 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stb-mnt 2.1.0
File Size Uploaded
stb_mnt-2.1.0.tar.gz 13.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stb-mnt 2.1.0
File Interpreter ABI Platform
stb_mnt-2.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 29.3 kB

Release files / stb_mnt-2.1.0.tar.gz

Download URL stb_mnt-2.1.0.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a093fc2cb63a3ab348772f234adf0c3fba0546126852367ba9730e6ad38825da
BLAKE2b-256 checksum
How to use checksums
e9e27a1053a405923d240e00531debd13be7cd70343aa65ba33b9a1d4609c0cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.8 Linux/6.0.15-1-MANJARO

Release files / stb_mnt-2.1.0-py3-none-any.whl

Download URL stb_mnt-2.1.0-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b3eafcd19e90c13cce63070d42f920693fe0bef0921428fbbc95723698633691
BLAKE2b-256 checksum
How to use checksums
87a675abfd26ed0b793d4dfac9b4a28a24e3c6f16def516c5824eba666df35a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.10.8 Linux/6.0.15-1-MANJARO

Release history Release notifications | RSS feed

4.9.1

2 release files

4.9.0

2 release files

4.8.0

2 release files

4.7.3

2 release files

4.7.2

2 release files

4.7.1

2 release files

4.7.0

2 release files

4.6.0

2 release files

4.5.3

2 release files

4.5.1

2 release files

4.5.0

2 release files

4.4.0

2 release files

4.2.0

2 release files

4.1.1

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.0

2 release files

3.0.0

2 release files

This release

2.1.0 This release

2 release files

2.0.0

2 release files

1.8.1

2 release files

1.8.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page