This guide defines a practical path for deploying applications with Codewise CLI.
The goal is to move safely through 3 stages:
- Local (developer machine)
- Staging (shared non-production cluster)
- Production (high-confidence rollout)
Use this stage to prove command flow and basic behavior.
- The project builds successfully.
- Automated tests pass.
- Kubernetes and Helm scaffolds generate correctly.
- Dry-run commands work without errors.
- At least one environment profile exists and loads correctly.
Run from project root:
- make build
- go test ./... -v
- ./codewise-cli helm init
- ./codewise-cli k8s init
- ./codewise-cli k8s apply --dry-run
- ./codewise-cli deploy plan --env dev
- This stage should not mutate any production resources.
- Keep context pointed to local clusters only (kind, minikube, k3d, etc.).
Use this stage to validate behavior in a real shared cluster.
- Environment-specific deployment works end-to-end.
- Rollout monitoring succeeds for all target deployments.
- Status, logs, and history commands are usable for troubleshooting.
- Rollback path is tested at least once on staging.
- Team can reproduce deployment steps from docs without tribal knowledge.
- ./codewise-cli env create staging
- ./codewise-cli deploy plan --env staging
- ./codewise-cli deploy run --env staging
- ./codewise-cli deploy status --env staging
- ./codewise-cli deploy logs --env staging --follow
- ./codewise-cli deploy history --env staging
- ./codewise-cli deploy rollback --env staging --revision
- Use a dedicated staging namespace and cluster context.
- Test rollback before any production attempt.
Use this stage only when reliability and observability are strong.
- Deploy package has automated tests for deploy logic (strategy resolution, command building, error paths).
- Preflight checks fail fast with actionable error messages.
- CI blocks merges on test failures.
- Rollback runbook is documented and time-to-recovery is known.
- A production promotion checklist exists and is followed.
- Confirm current kube context and namespace are correct.
- Run deployment plan for target environment.
- Verify image tag and chart/manifest inputs.
- Deploy with a human-in-the-loop approval.
- Confirm rollout and health signals.
- Confirm logs and status after rollout.
- Keep rollback command prepared with known-good revision.
- Yes for Local and Staging progression.
- No for full Production usage until deployment test coverage and runbook consistency are improved.
- Add deployment-focused automated tests under tests/deploy.
- Standardize docs and examples to use env-based deploy flags consistently.
- Improve deploy command output where subprocess stderr/stdout is currently suppressed.
- Add a release workflow for shipping the CLI binary (separate from app deployment).
This sequence gives fast progress without taking unnecessary production risk.