Deployments

Deployments represent specific builds and releases of your Git Deploy projects. Each deployment is tied to a specific Git commit and runs in an isolated confidential container.

What is a Deployment?

A deployment is created when:

  • You push code to your connected Git repository
  • You manually trigger a deployment via CLI or API
  • A webhook triggers from your Git provider

Each deployment goes through a build process and becomes an immutable, encrypted container instance.

Deployment Lifecycle

Build Phase

  1. QUEUED - Deployment is waiting in the build queue
  2. BUILDING - Source code is being built into a Docker image
  3. Build commands execute (e.g., npm install, npm run build)
  4. Docker image is created and encrypted

Deploy Phase

  1. DEPLOYING - Image is being deployed to confidential infrastructure
  2. Container starts with AMD SEV-SNP encryption
  3. Health checks verify the deployment
  4. ACTIVE - Deployment is live and serving traffic

Status States

  • QUEUED - Waiting for available build capacity
  • BUILDING - Build in progress
  • DEPLOYING - Deploying to production
  • ACTIVE - Live and serving requests
  • FAILED - Build or deployment failed
  • CANCELED - Manually canceled by user

Creating Deployments

Manual Trigger

# Deploy latest commit from main branch
teenode deployment create proj_abc123 \
  --commit-sha abc123def \
  --branch main

Git Push (Automatic)

Configure automatic deployments when you push to specific branches:

# Enable auto-deploy for main branch
teenode project update my-app \
  --auto-deploy-branch main

Now every push to main automatically triggers a new deployment.

Webhooks

Set up Git provider webhooks for advanced deployment triggers:

# Get webhook URL for your project
teenode project webhook my-app

# Add this URL to your GitHub/GitLab repository settings

Deployment URLs

Each deployment gets a unique URL:

# Production URL (always points to latest active deployment)
https://my-app.teenode.app

# Deployment-specific URL (immutable)
https://my-app-dep-xyz789.teenode.app
Deployment-specific URLs are useful for testing and previewing changes before promoting to production.

Deployment Configuration

Build Configuration

Configure how your project builds via teenode.json:

{
  "build": {
    "command": "npm run build",
    "output_dir": "dist"
  },
  "start": {
    "command": "npm start"
  },
  "env": {
    "NODE_ENV": "production"
  }
}

Environment Variables

Set environment variables for your deployments:

teenode env set my-app \
  DATABASE_URL="postgres://..." \
  API_KEY="secret123"

Environment variables are encrypted and only accessible inside your confidential container.

Monitoring Deployments

List Deployments

teenode deployment list proj_abc123

# Limit results
teenode deployment list proj_abc123 --limit 10

Get Deployment Info

teenode deployment info dep_xyz789

View Logs

# Build logs
teenode deployment logs dep_xyz789 --type build

# Runtime logs
teenode deployment logs dep_xyz789 --type runtime

# Follow logs in real-time
teenode deployment logs dep_xyz789 --follow

Rollback and Promotion

Rollback

Rollback to a previous deployment:

# Rollback to specific deployment
teenode deployment rollback dep_old123

# This creates a new deployment with the old configuration

Promote

Promote a deployment-specific URL to production:

# Make deployment the active production deployment
teenode deployment promote dep_xyz789

Deployment Strategies

Blue-Green Deployment

# Deploy to staging
teenode deployment create my-app --env staging

# Test on staging URL
curl https://my-app-staging.teenode.app

# Promote to production
teenode deployment promote dep_xyz789

Canary Deployment

# Deploy canary with 10% traffic
teenode deployment create my-app --canary 10

# Monitor metrics
teenode deployment metrics dep_xyz789

# Promote if healthy
teenode deployment promote dep_xyz789

Build Caching

Teenode automatically caches build dependencies to speed up deployments:

  • Node.js node_modules
  • Python venv and packages
  • Ruby gems
  • Go modules

Clear cache if needed:

teenode deployment create my-app --no-cache

Deployment Limits

  • Build time: Maximum 30 minutes
  • Build size: Maximum 10GB
  • Concurrent builds: 3 per team (Free), 10 per team (Pro)
  • Deployment retention: 30 days (Free), 90 days (Pro), unlimited (Enterprise)

Best Practices

  • Use semantic versioning in commit messages
  • Test deployments using deployment-specific URLs before promoting
  • Set up automated health checks
  • Monitor deployment metrics and logs
  • Keep deployment configurations in version control
  • Use environment variables for configuration
  • Implement gradual rollouts for critical applications

Troubleshooting

Build Failures

Common causes:

  • Missing dependencies in package.json
  • Build commands failing
  • Out of memory during build
  • Timeout (over 30 minutes)

Check build logs:

teenode deployment logs dep_xyz789 --type build

Runtime Failures

Check runtime logs and health check status:

teenode deployment logs dep_xyz789 --type runtime
teenode deployment info dep_xyz789

Related Concepts

    Deployments - Teenode Documentation