Dev tool to deploy git-tagged versions of a FastAPI app
Project description
Git Tag Deploy
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
/deploymentsFastAPI endpoint to check which versions are running and on which ports. - Simple CLI for one-command deployment.
Installation
Install via pip:
pip install .
This installs the package and registers the git-tag-deploy CLI.
Usage
- Ensure you have a
deployment.yamlfile in your repository, listing the apps and Git tags to deploy. - 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
5000to 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.yamlfile 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/deploymentsendpoint.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git_tag_deploy-0.1.0.tar.gz.
File metadata
- Download URL: git_tag_deploy-0.1.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0608008cf71d34883ad9b52ecff195bb7a23fa76085d50dd7aa5368aa9feff3a
|
|
| MD5 |
63b32cafb184a7b711e3d5d11e2680d1
|
|
| BLAKE2b-256 |
1277fb284c6c3ea21f7062edeae64c0be801f49a182365917665cf69b0fb67ea
|
File details
Details for the file git_tag_deploy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: git_tag_deploy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5264539e46471bcd61767c4d40947b3e0c1d65a5acad4de2aebf8f0c3ee3fec5
|
|
| MD5 |
9f00f5b4ddb382b8a1fa934901e736ba
|
|
| BLAKE2b-256 |
22d84fc565e4cafe0195ed62543ef67ba13c4be8329e4daa7ef65275bc051af1
|