Deploy Command
Learn how to deploy branches using Cased CLI
The deploy
command enables you to deploy branches to specific target environments. It provides both interactive and non-interactive modes for initiating deployments.
Usage
Options
--project
: Specify the project name to deploy (optional if already set)--branch
: Specify the branch to deploy (optional)--target
: Specify the target environment for deployment (optional)
Interactive Mode
If you run cased deploy
without the --branch
or --target
options, the CLI will enter interactive mode:
- The CLI will fetch and display a list of deployable branches
- You’ll be prompted to select a branch from the list
- After selecting a branch, you’ll be shown available target environments
- Select a target environment to initiate the deployment
Example interactive session:
Non-Interactive Mode
For automated workflows, you can specify all parameters directly:
Deployment Process
-
Branch Validation: The CLI verifies that:
- The branch exists
- The branch is deployable
- The branch has available target environments
-
Target Validation: The system checks if:
- The target environment is valid
- The selected branch can be deployed to the chosen target
-
Deployment Initiation: If all checks pass:
- The deployment is initiated
- A success message confirms the dispatch
- The deployment process begins
Status Messages
- Success:
"Dispatch succeeded. Starting deployment..."
- Failure:
"Deployment dispatch failed. Please try again later."
Error Cases
The command will exit with an error if:
- No deployable branches are found
- No branch is selected
- The selected branch is not deployable
- No targets are available for the selected branch
Error messages will provide guidance on how to resolve the issue, including a link to the project dashboard for more details.
Examples
Basic Usage
Common Workflows
-
Development Deployment
-
Production Release
-
Feature Testing
Best Practices
-
Branch Selection
- Ensure your branch is deployable before attempting deployment
- Verify that all required checks have passed
- Review the available targets for your branch
-
Target Selection
- Start with lower environments (staging) before production
- Verify the target environment is appropriate for your changes
- Ensure you have necessary permissions for the target environment
-
Deployment Verification
- Monitor the deployment progress after initiation
- Check deployment status using
cased deployments
- Verify the application status in the target environment
Troubleshooting
If you encounter issues:
- Verify your project selection using
cased projects
- Check branch status using
cased branches
- Confirm available targets with
cased targets
- Ensure you’re logged in with
cased login
- Visit the project dashboard for detailed status information