Zuplo CLI: Deploy
- Applies to
- Gatewayruntime for API, AI, and MCP gateways
- Hosting
- Managed EdgeManaged DedicatedSelf-HostedDiffers
1 difference by hosting option
To deploy on your own cluster, pass your cluster's management API endpoint with --self-hosted-endpoint. See Self-Hosted requirements.
Common use cases
The following examples assume that you are passing in your --api-key either as
an argument or through the ZUPLO_API_KEY environment variable.
Deploying your gateway
Code
Code
--environment is deprecated. Use --branch instead. If you pass both,
--branch wins. The CLI reads --branch only when you type it on the command
line. An exported ZUPLO_BRANCH environment variable doesn't set the branch
for deploy.
Deploying from CI/CD
Without --branch, the CLI names the environment after the current git branch.
CI systems usually check out a detached HEAD, in which case the CLI resolves the
branch from the remote branches that contain the checked-out commit. Two cases
break this inference:
- On GitHub Actions
pull_requestevents, the checkout is the pull request merge ref (refs/pull/<number>/merge) — a commit that doesn't exist on any branch — so the environment is named after that ref instead of your branch. - When the checked-out commit exists on more than one branch, the first match wins, which may not be the branch that triggered the build.
Always pass --branch explicitly in CI so that every trigger deploys the same,
predictably named environment:
Code
Deploying the same branch name always updates the same environment and keeps its
URL stable across deploys. This matters whenever an external system must match
the URL exactly — an OIDC token audience, a webhook registration, or an
allowlist. Capture the URL from the deploy output (Deployed to https://...) rather than constructing it from the branch name: the URL
hostname uses a normalized, truncated form of the branch name plus a unique
identifier. See Branch-Based Deployments
for the naming rules.
Cleaning up a branch deployment
To remove the environment that a branch deployed, pass the same branch name to
zuplo delete. You don't need the environment URL.
Code
Polling timeout
By default, the deploy command polls the status of the deployment every second for up to 250 attempts (a little over four minutes). For most deployments this is enough time for the build and deploy process to complete. However, if you have a large project, this may not be enough time. You can increase the timeout by setting the following environment variables.
POLL_INTERVAL- The interval in milliseconds between each poll. Default is1000(1 second).MAX_POLL_RETRIES- The maximum number of polls before the command times out. Default is250.
The following example polls every 5 seconds for up to 300 attempts (25 minutes).
Code
Note, that even if the CLI times out, the deployment will continue. You can check the status of the deployment in your project in the Zuplo Portal.
Examples
Deploy the current Git branch using the branch name as the environment name
Deploy as the my-feature branch, e.g. from a CI job; delete it later with `zuplo delete --branch my-feature`
Explicitly specify the account, project, and branch
Options
--account
The account name
string--branch
The branch name to deploy the environment as, instead of the current git branch. Overrides --environment
string--environment
The value to use for environment name, instead of the current branch name (deprecated: use --branch)
string--self-hosted-endpoint
The endpoint of your self-hosted service to deploy to
string--fetch-environments
Fetch the environments for your project from Zuplo. If this is false, then the environment will automatically be detected from the git branch.
booleanDefault: falseGlobal options
The following global options are available for all commands: