Production deployment
Deploying to production requires extra care. This guide covers the pre-deploy checklist, multi-environment configuration, deploy users, and rollback procedures.
Pre-production checklist
Complete these four steps before every production deployment:
- Verify on dev first - deploy to the development environment and confirm everything works. Never push untested code directly to production.
- Pull the prod state - run
npx comind pull app-your-taskagainst the production environment to check for web UI edits that haven't been committed to Git yet. Resolve any differences before deploying. - Use a deploy user - deploy through a dedicated Comind.work user account so the audit trail clearly shows automated or planned deployments (see deploy user setup below).
- Know your backup position - confirm you can identify the last known-good state in Git so you can roll back quickly if needed.
Multi-environment configuration
Create a separate environment file for production:
cp .config/dev.env .config/prod.env
Edit .config/prod.env with your production credentials and URL. Then switch environments by commenting/uncommenting in your root .env file:
# COMIND_ENV=dev
COMIND_ENV=prod
To switch back, comment out prod and uncomment dev. For full details on environment switching, see environment variables.
Install vs push on production
Both commands deploy code, but they serve different purposes:
| Command | What it does | When to use |
|---|---|---|
install | Compiles and uploads in one atomic operation | Preferred for production - consistent and reliable |
push | Uploads raw source files to AppCode | Use when you need source traceability on the server |
For most production deployments, install is the safer choice. It ensures the deployed code is compiled from a known state.
Deploy user setup
Create a dedicated Comind.work user for automated or scripted deployments. This keeps the audit trail clean - you can immediately tell whether a change came from a human editing in the web UI or from a planned deployment.
To set up a deploy user:
- Create a new user in your Comind.work workspace (e.g.,
deploy-botorci-deploy) - Grant the user the necessary app permissions
- Generate an auth token for that user
- Use the token in your production
.config/prod.env:
COMIND_SECRET_AUTH_CODE_MANAGEMENT=deploy-user-token-here
COMIND_BASE_URL=https://YOUR-ORG.comindwork.com
COMIND_API_V1_URL=https://api.comindwork.com
Signed commits on the prod branch are still required regardless of which user runs the deploy. See the git workflow for branching rules.
API version mismatch warnings
You may see API version mismatch warnings when deploying. On development environments, these are safe to ignore - they indicate a minor version difference between the CLI and the server API. On production, check that the warning doesn't indicate a breaking change before proceeding.
Rollback
If a production deployment causes issues:
- Identify the last known-good commit in Git
- Check out that commit or reset to it
- Pull the current production state to preserve any data changes:
npx comind pull app-your-task - Re-install from the known-good code:
npx comind install app-your-task
The combination of Git history and the pull command gives you a clear path back to a working state.
Related
- CLI reference - full command syntax for install, push, and pull
- Git workflow - branching strategy and sync workflow
- Testing apps - run automated tests before deploying to production