Deploy the application to specified environment.
Deploys application to specified environment with pre-flight checks and verification
/plugin marketplace add varaku1012/aditi.code/plugin install devops-toolkit@aditi-code-pluginsDeploy the application to specified environment.
/deploy staging # Deploy to staging
/deploy production # Deploy to production
/deploy staging --dry-run # Preview without deploying
/deploy production --force # Skip confirmation
# Verify clean working directory
git status --porcelain
# Ensure on correct branch
git branch --show-current
# Run tests
pytest tests/ -q
# Check build
python -m build --check
# Build Docker image
docker build -t app:${VERSION} .
# Run security scan
docker scan app:${VERSION}
# Railway
railway up --environment ${ENV}
# Kubernetes
kubectl apply -f k8s/${ENV}/
# Docker Compose
docker-compose -f docker-compose.${ENV}.yml up -d
# Health check
curl -f https://${APP_URL}/health
# Smoke tests
pytest tests/smoke/ --env=${ENV}
# railway.toml
[build]
builder = "nixpacks"
[deploy]
healthcheckPath = "/health"
healthcheckTimeout = 300
restartPolicyType = "on_failure"
# Dockerfile
FROM python:3.12-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["python", "main.py"]
# k8s/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: infinite-video
spec:
replicas: 2
selector:
matchLabels:
app: infinite-video
template:
spec:
containers:
- name: app
image: infinite-video:latest
Preview all deployment steps without executing:
/deploy production --dry-run
Would execute:
1. Run test suite
2. Build Docker image
3. Push to registry
4. Update deployment
5. Run health checks
Automatic rollback on failure:
# Manual rollback
/deploy rollback production
# To specific version
/deploy rollback production --version v1.2.3
Production deployments require:
In deploy.yaml:
environments:
staging:
url: staging.infinitevideo.ai
auto_deploy: true
branch: develop
production:
url: infinitevideo.ai
auto_deploy: false
branch: main
approval_required: true
health_check:
endpoint: /health
timeout: 30
retries: 3