Release Tracker supports multiple configuration sources to fit different deployment scenarios. You can specify the configuration source using the CONFIG_SOURCE
environment variable or the --config=
CLI argument.
Load configuration from a local YAML file.
Format: config.yaml
or /path/to/config.yaml
Example:
export CONFIG_SOURCE="config.yaml"
# or
python main.py --config=config.yaml
Load configuration from a remote HTTP(S) endpoint.
Format: https://domain.com/path/to/config.yaml
Features:
Example:
export CONFIG_SOURCE="https://raw.githubusercontent.com/user/repo/main/config.yaml"
Load configuration from an S3 bucket.
Format: s3://bucket-name/path/to/config.yaml
Environment Variables:
AWS_ACCESS_KEY_ID
- AWS access keyAWS_SECRET_ACCESS_KEY
- AWS secret keyAWS_REGION
- AWS regionS3_ENDPOINT_URL
- Custom S3 endpoint (optional)Example:
export CONFIG_SOURCE="s3://my-configs/release-tracker/config.yaml"
export AWS_ACCESS_KEY_ID="AKIA..."
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="us-east-1"
Configuration sources are checked in this order:
--config=source
CONFIG_SOURCE=source
config.yaml
# Development
export CONFIG_SOURCE="git+https://github.com/company/configs/dev-config.yaml@dev"
# Staging
export CONFIG_SOURCE="consul://consul-staging:8500/release-tracker/config"
# Production
export CONFIG_SOURCE="aws-ssm:///prod/release-tracker/config"
version: '3.8'
services:
release-tracker:
image: release-tracker
environment:
- CONFIG_SOURCE=consul://consul:8500/release-tracker/config
- CONSUL_TOKEN=${CONSUL_TOKEN}
depends_on:
- consul
apiVersion: v1
kind: ConfigMap
metadata:
name: release-tracker-config
data:
CONFIG_SOURCE: "aws-ssm:///k8s/release-tracker/"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: release-tracker
spec:
template:
spec:
containers:
- name: release-tracker
image: release-tracker
envFrom:
- configMapRef:
name: release-tracker-config
env:
- name: AWS_REGION
value: "us-east-1"
All configuration loaders include:
To add a new configuration source:
ConfigLoader
load()
methodconfig/loader.py
Example:
from config.loaders.base import ConfigLoader
class MyCustomLoader(ConfigLoader):
def load(self) -> dict[str, Any]:
# Your implementation here
return config