product:clean

Introduction

product:clean resets your product completely. It stops its containers, deletes their volumes, the database included, and empties the protected uploads and the log. Use it when the environment has drifted, or when a change needs a fresh database.

splent product:clean
⚠️  This will completely wipe sample_splent_app (dev):
  - Stop all Docker containers and DELETE ALL VOLUMES/DATA, the database included (irreversible)
  - Empty the protected uploads and the application log

Continue? [y/N]: y

🐳 Stopping containers and removing volumes...
  🛑  sample_splent_app stopped and volumes removed.
  🛑  splent_io/splent_feature_cache@v1.5.6 stopped and volumes removed.

🗂️  Clearing uploads...
  ✔ Uploads cleared.

📋 Clearing application log...
  ✔ Log cleared.

✅ sample_splent_app (dev) fully cleaned. Run 'splent product:derive --dev' to start fresh.

This is irreversible. Every Docker volume of the product and its features is deleted.


What it cleans

  1. It runs docker compose down -v for the product and every feature of the environment that has a compose file. A sibling product running the same feature keeps its volumes.
  2. It runs clear:uploads --yes, which empties PROTECTED_UPLOADS_DIR.
  3. It runs clear:log, which truncates the application log.

The next start creates the database again and applies the migrations. When a step fails, the command warns, runs the next one, and ends with <product> (<env>) was not fully cleaned; see the warnings above. and exit 1.


Cleaning without a prompt

splent product:clean --yes

Use --yes only in a pipeline where wiping the data is the intent.


Cleaning production

splent product:clean --prod

This cleans the stack product:up --prod started, <product>_prod. The production web container is down by the time uploads are cleared, so nothing is deleted from the CLI container (see Where it runs).

A deployment started with product:deploy runs as <product>_deploy and is not touched. Stop it, volumes included, with splent product:down --prod --v.


Reference

Options

Option Description
--dev Use the development compose files
--prod Use the production compose files
--yes Do not ask for confirmation

Without --dev or --prod, it uses SPLENT_ENV, and dev when that is unset.


Requirements

  • A selected product (SPLENT_APP).
  • Docker running.

See also


Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es