Skip to main content

A universal tool for local microservice management.

Project description

stb

A universal tool for local microservice management

Installation

pipx install stb-mnt

Usage

Setup

  • To download and setup my_company/backend/service1 microservice as a subdirectory to the current working directory, use:
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:
stb setup my_company/backend/service1 my_company/backend/service2
  • To setup all backend services, use:
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:
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 update poetry.lock file, install dependencies, stash current changes, checkout to master, pull from remote, and recreate databases:
stb update package -piucd

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, 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:
stb use ../my_package
  • To install a local version of my_package that is located at ../my_package in editable mode:
stb use ../my_package --editable
  • To install a cloud version of my_package with tag 8.3.1:
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:
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:
stb run service1 service2

Config

  • To set a git url for cloning:
stb config set git_url git@gitlab.my_company.com

Graph

  • To get a dependency graph of your microservices:
stb graph json my_company/backend/ my_company/infrastructure/
  • To get a dependency graph of your microservices as an svg image (requires graphviz):
stb graph graphviz my_company/backend/ my_company/infrastructure/

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stb_mnt-4.5.0.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stb_mnt-4.5.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

Details for the file stb_mnt-4.5.0.tar.gz.

File metadata

  • Download URL: stb_mnt-4.5.0.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.9 Linux/6.0.19-4-MANJARO

File hashes

Hashes for stb_mnt-4.5.0.tar.gz
Algorithm Hash digest
SHA256 8751ba8581226f69bff19bd5ef5d3b0aa6c98f5327041c34c0883097499b1486
MD5 b08c7d78be5743991ac0747d002313f9
BLAKE2b-256 b26a337ad4aa81c262f86740fe8922c57bc920026f3652f38a6936aac168ff64

See more details on using hashes here.

File details

Details for the file stb_mnt-4.5.0-py3-none-any.whl.

File metadata

  • Download URL: stb_mnt-4.5.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.9 Linux/6.0.19-4-MANJARO

File hashes

Hashes for stb_mnt-4.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c05ec05fa1909a88d8f396dbf1b15475a4ca2c396f76fa9977de782c8a2dfa2
MD5 7f2b6ce6bc770162a741c15568c02c26
BLAKE2b-256 970d4687ee7e71ba3d8a446b8a46fec9bf4c535865471bd684fbae58530cc019

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page