Make WordPress Core

Changeset 59393


Ignore:
Timestamp:
11/12/2024 05:44:38 PM (3 months ago)
Author:
desrosj
Message:

Build/Test Tools: Prevent orphaned Docker containers.

This updates certain local Docker environment commands to include --rm, which instructs docker compose to remove the container after running the specified scripts.

Previously only the installation script contained --rm. But running test:php, env:start, or env:cli resulted in the container remaining.

Props johnbillion.
Fixes #62395.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/package.json

    r59368 r59393  
    180180        "lint:jsdoc": "wp-scripts lint-js",
    181181        "lint:jsdoc:fix": "wp-scripts lint-js --fix",
    182         "env:start": "node ./tools/local-env/scripts/start.js && node ./tools/local-env/scripts/docker.js run -T php composer update -W",
     182        "env:start": "node ./tools/local-env/scripts/start.js && node ./tools/local-env/scripts/docker.js run -T --rm php composer update -W",
    183183        "env:stop": "node ./tools/local-env/scripts/docker.js down",
    184184        "env:restart": "npm run env:stop && npm run env:start",
     
    186186        "env:reset": "node ./tools/local-env/scripts/docker.js down --rmi all -v --remove-orphans",
    187187        "env:install": "node ./tools/local-env/scripts/install.js",
    188         "env:cli": "node ./tools/local-env/scripts/docker.js run cli",
     188        "env:cli": "node ./tools/local-env/scripts/docker.js run --rm cli",
    189189        "env:logs": "node ./tools/local-env/scripts/docker.js logs",
    190190        "env:pull": "node ./tools/local-env/scripts/docker.js pull",
    191191        "test:performance": "wp-scripts test-playwright --config tests/performance/playwright.config.js",
    192         "test:php": "node ./tools/local-env/scripts/docker.js run php ./vendor/bin/phpunit",
     192        "test:php": "node ./tools/local-env/scripts/docker.js run --rm php ./vendor/bin/phpunit",
    193193        "test:coverage": "npm run test:php -- --coverage-html ./coverage/html/ --coverage-php ./coverage/php/report.php --coverage-text=./coverage/text/report.txt",
    194194        "test:e2e": "wp-scripts test-playwright --config tests/e2e/playwright.config.js",
Note: See TracChangeset for help on using the changeset viewer.