Skip to main content

Dev tool to deploy git-tagged versions of a FastAPI app

Project description

Git Tag Deploy

Python Version PyPI version FastAPI Pre-commit Hooks Code Style: Black License

A lightweight developer tool to deploy multiple Git-tagged versions of a FastAPI application simultaneously, each on its own dynamically assigned port. Includes a simple FastAPI endpoint to view all active deployments.


Features

  • Deploy any number of Git tags from your repository.
  • Automatically assigns free ports in the range 8001-9000.
  • Each deployment runs in its own daemon process — terminates automatically when the main starter process exits.
  • Provides a /deployments FastAPI endpoint to check which versions are running and on which ports.
  • Simple CLI for one-command deployment.

Installation

Install via pip using the pypi package:

pip install git-tag-deploy

This installs the package and registers the git-tag-deploy CLI.


Usage

  1. Ensure you have a deployment.yaml file in your repository, listing the apps and Git tags to deploy.
  2. Run the CLI:
git-tag-deploy

The CLI will:

  • Deploy all Git-tagged apps to dynamically assigned ports.
  • Print the deployed apps and ports in the console.
  • Start a FastAPI server on port 5000 to expose /deployments.

Example console output:

Starting deployments...

Deployments started:
 - service1: tag=v1.0.0, port=8001
 - service2: tag=v1.1.0, port=8002

FastAPI status server running at http://127.0.0.1:5000/deployments

Visit http://127.0.0.1:5000/deployments to see JSON information of all active deployments.


Project Structure

tenbatsu24-git-tag-deployment/
├── pyproject.toml        # Project configuration and dependencies
└── git_tag_deploy/       # Main package
    ├── __init__.py
    ├── cli.py            # CLI entry point
    ├── deployer.py       # Deployment logic and process management
    └── server.py         # FastAPI endpoint for deployment info

Dependencies

  • Python 3.10+
  • PyYAML – for reading deployment configuration
  • FastAPI – for the status server
  • uvicorn – ASGI server for deployed apps

How It Works

  • Reads the deployment.yaml file to determine which Git tags to deploy.
  • Clones the repository for each tag into a temporary directory.
  • Starts each deployment in a daemonized process, running uvicorn on a free port.
  • Tracks deployments in memory (tag + port) for the FastAPI /deployments endpoint.

Future Improvements

  • Implement logging for deployment processes.
  • Add health checks for deployed applications.
  • Clean up temporary directories after deployments.
  • Custom deployment scripts/hooks. (not just uvicorn app.main:app)
  • Docker support for containerized deployments of git tags.

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.

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

git_tag_deploy-0.2.1.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

git_tag_deploy-0.2.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file git_tag_deploy-0.2.1.tar.gz.

File metadata

  • Download URL: git_tag_deploy-0.2.1.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for git_tag_deploy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 8f6a5d90f343cf552a6dfa03bf533cb2be2ceeba4667e1b5a3d63b1b2c132795
MD5 6a8c5755c8c27a20ec787bfc09610da6
BLAKE2b-256 84aace8f24a44839e914c87331e5155e3059e8e7d1d38be9b4a15b31206e72ae

See more details on using hashes here.

File details

Details for the file git_tag_deploy-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: git_tag_deploy-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for git_tag_deploy-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba4faa13d94314f60dcb494754c801e82a026c0d33fa37231fcde7d030728a98
MD5 4d8aafce162b07a6de4be7fb05cf5b72
BLAKE2b-256 d053498e011097ccb2809e34459399c471e15ebc265c9784702eaf25d1eef4e6

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