Deploying

Deploy functions to Cluster — preview and production deployments, promote, and undeploy.

Deploying

ccp deploy bundles your code, uploads it, and activates a deployment on Cluster's serverless runtime.

Deploy to Production

ccp deploy --prod
# ◼ Building Function...
# ◼ Creating Deployment...
# ◼ Uploading code...
# ◼ Deploying...
# ◼ my-app deployed!
# › https://my-app.clusterbase.dev

The --prod flag (alias: --production) makes this the active production deployment, served at https://{function-name}.clusterbase.dev.

Preview Deployments

Without --prod, you get a preview deployment with its own URL:

ccp deploy
# ◼ my-app deployed!
# › https://abc123.clusterbase.dev

Preview deployments are useful for testing changes before promoting to production.

Promote a Preview

Promote any preview deployment to production:

ccp promote <deployment-id>

This swaps the production deployment to the given deployment ID without redeploying.

Undeploy

Remove a specific deployment:

ccp undeploy <deployment-id>

List Deployments

ccp list        # or: ccp ls

Shows all deployments for the linked function with their IDs, status, and timestamps.

Deploy Options

FlagDescription
--prod / --productionDeploy as the production deployment
--public-dir <path>Include a public directory for static assets
--client <path>Include a client-side script
<path>Path to a file or directory (defaults to current directory)

How It Works

  1. Bundle — esbuild compiles your TypeScript/JavaScript into a single ESM bundle
  2. Upload — The bundle (and any assets) are uploaded directly to Cluster's storage API
  3. Activate — The API publishes a deploy event via Redis pub/sub
  4. Route — Traefik routes are created for {function-name}.clusterbase.dev and {deployment-id}.clusterbase.dev
  5. Serve — The serverless runtime creates a V8 isolate and starts handling requests

First Deploy

On your first deploy, if .cluster/config.json doesn't have a function_id, CCP will prompt you to:

  1. Select an organization
  2. Link to an existing function or create a new one
  3. The function ID is saved to .cluster/config.json for future deploys

Build Without Deploying

To test the build step without deploying:

ccp build

This runs the esbuild bundle and reports any errors, but doesn't upload or activate anything.

On this page