product:deploy
Deploy the product using docker-compose.deploy.yml and .env.deploy.
Usage
splent product:deploy [--ci] [--down]
Options
| Option | Description |
|---|---|
--ci |
Non-interactive mode for CI/CD pipelines. Variables marked <SET> are read from system environment variables instead of prompting. |
--down |
Stop the running deployment instead of starting it. |
Description
This command deploys the active product using the deployment artifacts generated by product:build.
It:
- Requires
docker-compose.deploy.ymland.env.deploy.example(generated byproduct:build). - Creates
.env.deployfrom the template if it doesn’t exist. - Syncs
.env.deploywith the template — infrastructure variables are updated from the template, user-configured values (those that were<SET>and filled in) are preserved. This means you can re-runproduct:build+product:deploywithout losing your passwords or domain settings. - Prompts interactively for variables with
<SET>values. In--cimode, reads from system environment variables instead. - Sets
SPLENT_ENV=prodin the product’s.envso the workspace knows the active environment. - Checks for port conflicts and offers to stop conflicting containers.
- Deploys with
docker compose -f docker-compose.deploy.yml --env-file .env.deploy up -d --build. - Health checks the app and shows the URL.
Environment sync strategy
When .env.deploy already exists from a previous deploy, the command syncs it with the latest template:
| Variable in template | Variable in existing .env.deploy | Result |
|---|---|---|
MARIADB_HOSTNAME=my_first_app_db |
MARIADB_HOSTNAME=my_first_app_db_deploy (stale) |
Updated from template |
MARIADB_PASSWORD=<SET> |
MARIADB_PASSWORD=secret123 (user-configured) |
Preserved |
SPLENT_ENV=prod |
(missing) | Added |
REDIS_HOST_PORT=6971 |
REDIS_HOST_PORT=6971 (same) |
No change |
The rule: the template is the source of truth for everything except <SET> values the user already filled in.
Workflow
Typical deployment flow:
splent product:build
splent product:deploy
Requirements
- A product must be selected (
SPLENT_APPset). - You must run
splent product:buildbefore deploying.
CI/CD example
export DB_PASSWORD=secret
export SECRET_KEY=abc123
splent product:build
splent product:deploy --ci
In --ci mode, every <SET> placeholder in .env.deploy.example is resolved from the corresponding system environment variable. If a variable is missing, the command fails with an error.