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.devThe --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.devPreview 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 lsShows all deployments for the linked function with their IDs, status, and timestamps.
Deploy Options
| Flag | Description |
|---|---|
--prod / --production | Deploy 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
- Bundle — esbuild compiles your TypeScript/JavaScript into a single ESM bundle
- Upload — The bundle (and any assets) are uploaded directly to Cluster's storage API
- Activate — The API publishes a deploy event via Redis pub/sub
- Route — Traefik routes are created for
{function-name}.clusterbase.devand{deployment-id}.clusterbase.dev - 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:
- Select an organization
- Link to an existing function or create a new one
- The function ID is saved to
.cluster/config.jsonfor future deploys
Build Without Deploying
To test the build step without deploying:
ccp buildThis runs the esbuild bundle and reports any errors, but doesn't upload or activate anything.