diff --git a/Makefile b/Makefile index 78191439d8..92e09a655e 100644 --- a/Makefile +++ b/Makefile @@ -32,8 +32,8 @@ endif restart exec up down stop \ build build-missing build-no-cache build-no-cache-all build-cleanup \ act-all act-app act-workflow \ - deploy-fresh-kept-app container-refresh-inventory deploy-reuse-kept-all container-purge-entity container-purge-system \ - deploy-fresh-purged-app deploy-reuse-kept-app deploy-reuse-purged-app deploy-fresh-kept-all \ + deploy-fresh-kept-apps container-refresh-inventory deploy-reuse-kept-all container-purge-entity container-purge-system \ + deploy-fresh-purged-apps deploy-reuse-kept-apps deploy-reuse-purged-apps deploy-fresh-kept-all \ bootstrap setup-development # Bootstrap the local development environment. @@ -295,17 +295,17 @@ deploy-fresh-kept-all: @echo "=== local full deploy (type=$${TEST_DEPLOY_TYPE}, distro=$${INFINITO_DISTRO}) ===" @bash scripts/tests/deploy/local/deploy/fresh-kept-all.sh -# Create a fresh inventory and deploy one app. -deploy-fresh-kept-app: +# Create a fresh inventory and deploy one or more apps. +deploy-fresh-kept-apps: @: "$${APPS:?APPS must be set (e.g. APPS=web-app-nextcloud)}" @bash scripts/tests/deploy/local/deploy/fresh-kept-app.sh "$${APPS}" -# Recreate the stack and deploy one app with a purged entity. -deploy-fresh-purged-app: down up +# Recreate the stack and deploy one or more apps with purged entities. +deploy-fresh-purged-apps: down up @bash scripts/tests/deploy/local/deploy/fresh-purged-app.sh -# Redeploy one app on an existing inventory. -deploy-reuse-kept-app: +# Redeploy one or more apps on an existing inventory. +deploy-reuse-kept-apps: @DEBUG=true \ bash scripts/tests/deploy/local/deploy/reuse-kept-app.sh @@ -313,6 +313,6 @@ deploy-reuse-kept-app: deploy-reuse-kept-all: @bash scripts/tests/deploy/local/deploy/reuse-kept-all.sh -# Purge one app entity, then redeploy it on existing inventory. -deploy-reuse-purged-app: container-purge-entity - @$(MAKE) deploy-reuse-kept-app +# Purge one or more app entities, then redeploy them on existing inventory. +deploy-reuse-purged-apps: container-purge-entity + @$(MAKE) deploy-reuse-kept-apps diff --git a/docs/agents/action/iteration.md b/docs/agents/action/iteration.md index 165e9339de..8f49255e1b 100644 --- a/docs/agents/action/iteration.md +++ b/docs/agents/action/iteration.md @@ -4,13 +4,13 @@ Use this page when you are iterating on a local app deploy during debugging or d ## Loop -- Unless the user explicitly says to reuse the existing setup, you MUST start once with `APPS= make deploy-fresh-purged-app` to establish the baseline inventory and clean app state. -- After that, you MUST use `APPS= make deploy-reuse-kept-app` for the default edit-fix-redeploy loop. -- Do NOT rerun `APPS= make deploy-fresh-purged-app` just because a deploy failed or you changed code. That restarts the stack unnecessarily and burns time. -- If the same failure still reproduces on the reuse path and you want to test whether app entity state is involved, use `APPS= make deploy-reuse-purged-app` once. -- After that targeted purge check, you MUST return to `APPS= make deploy-reuse-kept-app`. -- Only go back to `APPS= make deploy-fresh-purged-app` if you have concrete evidence that the inventory or host stack is broken, or you intentionally need a fresh single-app baseline again. -- If you need to validate the single-app init/deploy path separately, use `APPS= make deploy-fresh-kept-app`. It checks the clean single-app setup apart from the faster reuse path. +- Unless the user explicitly says to reuse the existing setup, you MUST start once with `APPS= make deploy-fresh-purged-apps` to establish the baseline inventory and clean app state. +- After that, you MUST use `APPS= make deploy-reuse-kept-apps` for the default edit-fix-redeploy loop. +- Do NOT rerun `APPS= make deploy-fresh-purged-apps` just because a deploy failed or you changed code. That restarts the stack unnecessarily and burns time. +- If the same failure still reproduces on the reuse path and you want to test whether app entity state is involved, use `APPS= make deploy-reuse-purged-apps` once. +- After that targeted purge check, you MUST return to `APPS= make deploy-reuse-kept-apps`. +- Only go back to `APPS= make deploy-fresh-purged-apps` if you have concrete evidence that the inventory or host stack is broken, or you intentionally need a fresh single-app baseline again. +- If you need to validate the single-app init/deploy path separately, use `APPS= make deploy-fresh-kept-apps`. It checks the clean single-app setup apart from the faster reuse path. ## Certificate Authority diff --git a/docs/contributing/development/testing.md b/docs/contributing/development/testing.md index 74bf573ae4..3fc5ae6e99 100644 --- a/docs/contributing/development/testing.md +++ b/docs/contributing/development/testing.md @@ -36,10 +36,10 @@ Use the following table when you need realistic local deployment validation or a | Category | Command | What it does | When to use it | |---|---|---|---| -| Local deploy | `APPS=web-app-nextcloud make deploy-fresh-kept-app` | Creates the needed inventory and deploys one app. | Single-app `devices.yml` path. | -| Local deploy | `APPS=web-app-nextcloud make deploy-reuse-kept-app` | Reuses an existing `devices.yml` inventory and redeploys one app quickly. | Fast reuse path. | -| Local deploy | `APPS=web-app-nextcloud make deploy-reuse-purged-app` | Reuses an existing `devices.yml` inventory, purges the entity first, and redeploys one app quickly. | Fast reuse path after a state reset. | -| Local deploy and E2E | `APPS=web-app-matomo make deploy-fresh-purged-app` | Runs a dedicated local validation flow for one app against the dev stack, creating and re-initializing the inventory first. | Baseline and recovery path. | +| Local deploy | `APPS=web-app-nextcloud make deploy-fresh-kept-apps` | Creates the needed inventory and deploys one or more apps. | Fresh deploy for a specific app set. | +| Local deploy | `APPS=web-app-nextcloud make deploy-reuse-kept-apps` | Reuses an existing `devices.yml` inventory and redeploys one or more apps quickly. | Fast reuse path. | +| Local deploy | `APPS=web-app-nextcloud make deploy-reuse-purged-apps` | Reuses an existing `devices.yml` inventory, purges the entity first, and redeploys one or more apps quickly. | Fast reuse path after a state reset. | +| Local deploy and E2E | `APPS=web-app-matomo make deploy-fresh-purged-apps` | Runs a dedicated local validation flow for one or more apps against the dev stack, creating and re-initializing the inventory first. | Baseline and recovery path. | | Full local validation | `make deploy-fresh-kept-all` | Builds the broader local deployment flow across apps. | Broad coverage when you explicitly need it. | | Local reset | `make container-refresh-inventory` | Recreates the local inventory without deploying apps. | Use this when your local inventory is broken or you want a clean reset. | | Local cleanup | `make container-purge-system` | Deletes local deploy artifacts and cleanup data. | Use this only when you really want to remove local state. | diff --git a/docs/contributing/environment/hardware.md b/docs/contributing/environment/hardware.md index a40b62ca7c..42e5651175 100644 --- a/docs/contributing/environment/hardware.md +++ b/docs/contributing/environment/hardware.md @@ -40,7 +40,7 @@ For a broad stack like the Community Hub, you SHOULD start only the services you You MAY set the `SERVICES_DISABLED` environment variable before creating the inventory to disable services automatically across all applications without editing any file: ```bash -SERVICES_DISABLED="matomo" make deploy-fresh-purged-app APPS=web-app-discourse +SERVICES_DISABLED="matomo" make deploy-fresh-purged-apps APPS=web-app-discourse ``` This sets `enabled: false` and `shared: false` for every listed service in the generated inventory. See [variables.md](variables.md) for details. @@ -73,13 +73,13 @@ On small machines, you SHOULD limit validation to the role you are touching. For Discourse, start with: ```bash -SERVICES_DISABLED="matomo" APPS=web-app-discourse make deploy-fresh-purged-app +SERVICES_DISABLED="matomo" APPS=web-app-discourse make deploy-fresh-purged-apps ``` If the local inventory and stack already exist, you SHOULD reuse them: ```bash -SERVICES_DISABLED="matomo" APPS=web-app-discourse make deploy-reuse-kept-app +SERVICES_DISABLED="matomo" APPS=web-app-discourse make deploy-reuse-kept-apps ``` You SHOULD use `make deploy-fresh-kept-all` only when you need broad coverage and have enough time and resources. diff --git a/docs/contributing/environment/setup.md b/docs/contributing/environment/setup.md index b6d2c9b042..80bdc4cd16 100644 --- a/docs/contributing/environment/setup.md +++ b/docs/contributing/environment/setup.md @@ -67,7 +67,7 @@ The repository already contains a development helper script at [environment.sh]( | 2 | `make environment-bootstrap` | Prepares the host machine for local development. | | 3 | `make up` | Starts the development stack. | | 4 | `make test` | Runs the main combined validation flow. | -| 5 | `APPS=web-app-matomo make deploy-fresh-purged-app` | Runs the baseline validation path for one concrete app. For the retry-loop policy, see [Iteration](../../agents/action/iteration.md). | +| 5 | `APPS=web-app-matomo make deploy-fresh-purged-apps` | Runs the baseline validation path for one concrete app. For the retry-loop policy, see [Iteration](../../agents/action/iteration.md). | | 6 | `make trust-ca` | Makes the generated local certificates trusted by the host browser. | | 7 | `make down` | Stops the running development stack. | | 8 | `make environment-teardown` | Cleans up host-side development environment changes. | diff --git a/docs/contributing/tools/makefile.md b/docs/contributing/tools/makefile.md index d8a6df1d7d..acbdcde7d1 100644 --- a/docs/contributing/tools/makefile.md +++ b/docs/contributing/tools/makefile.md @@ -112,10 +112,10 @@ Use the dedicated script READMEs for the underlying shell helpers, and use the d | Category | Command | What it does | When to use it | |---|---|---|---| -| Fresh kept app | `make deploy-fresh-kept-app` | Creates a new inventory and deploys one app. | Use this for the single-app fresh path. | -| Fresh purged app | `make deploy-fresh-purged-app` | Creates a new inventory, purges the app state, and redeploys one app. | Use this when you want a fresh app after cleanup. | -| Reuse kept app | `make deploy-reuse-kept-app` | Reuses an existing inventory and redeploys one app quickly. | Use this for the fast reuse path. | -| Reuse purged app | `make deploy-reuse-purged-app` | Reuses an existing inventory, purges the app state first, and redeploys one app quickly. | Use this when you want a fast reset-and-redeploy path. | +| Fresh kept apps | `make deploy-fresh-kept-apps` | Creates a new inventory and deploys one or more apps. | Use this for a fresh deploy of a specific app set. | +| Fresh purged apps | `make deploy-fresh-purged-apps` | Creates a new inventory, purges the app state, and redeploys one or more apps. | Use this when you want a fresh deploy after cleanup. | +| Reuse kept apps | `make deploy-reuse-kept-apps` | Reuses an existing inventory and redeploys one or more apps quickly. | Use this for the fast reuse path. | +| Reuse purged apps | `make deploy-reuse-purged-apps` | Reuses an existing inventory, purges the app state first, and redeploys one or more apps quickly. | Use this when you want a fast reset-and-redeploy path. | | Fresh kept all | `make deploy-fresh-kept-all` | Builds the broader local deployment flow across apps. | Use this when you explicitly need broad coverage. | | Reuse kept all | `make deploy-reuse-kept-all` | Reuses the existing inventory and redeploys the broad app set. | Use this for the faster broad reuse path. | diff --git a/scripts/tests/deploy/local/deploy/README.md b/scripts/tests/deploy/local/deploy/README.md index e091178d0e..5eb06a1f5a 100644 --- a/scripts/tests/deploy/local/deploy/README.md +++ b/scripts/tests/deploy/local/deploy/README.md @@ -18,7 +18,7 @@ For the canonical Make target index that invokes these helpers, see [docs/contri - `reuse` means the flow uses an already existing inventory. - `kept` means the stack and app state stay in place. - `purged` means the flow removes the app or stack state before redeploying. -- `app` means one application, `all` means every discovered application. +- `apps` means one or more applications, `all` means every discovered application. ## Entry Points @@ -26,6 +26,6 @@ For the canonical Make target index that invokes these helpers, see [docs/contri |---|---|---|---| | `fresh-kept-all.sh` | Discovers apps, creates `devices.yml`, and deploys all discovered apps. | `INFINITO_DISTRO`, `TEST_DEPLOY_TYPE`, `INVENTORY_DIR` | Fresh all-app inventory path. | | `reuse-kept-all.sh` | Deploys every app from an existing inventory. | `INFINITO_DISTRO`, `TEST_DEPLOY_TYPE`, `INVENTORY_DIR` | Requires `${INVENTORY_DIR}/devices.yml` and `.password`. | -| `fresh-kept-app.sh ` | Creates `devices.yml` for one app and deploys it. | `APPS=` | Single-app init and deploy path. | -| `reuse-kept-app.sh` | Runs a targeted `infinito deploy dedicated` for one app. | `APPS`, `TEST_DEPLOY_TYPE`, `INFINITO_CONTAINER`, `DEBUG`, `INVENTORY_DIR` | Reuses `devices.yml`. | -| `fresh-purged-app.sh` | Recreates `devices.yml` and deploys one app twice with `ASYNC_ENABLED=false` and `ASYNC_ENABLED=true`. | `INFINITO_DISTRO`, `INVENTORY_DIR`, `TEST_DEPLOY_TYPE`, `APPS` | Baseline and recovery path. | +| `fresh-kept-app.sh ` | Creates `devices.yml` for one or more apps and deploys them. | `APPS=` | Init and deploy path for a specific app set. | +| `reuse-kept-app.sh` | Runs a targeted `infinito deploy dedicated` for one or more apps. | `APPS`, `TEST_DEPLOY_TYPE`, `INFINITO_CONTAINER`, `DEBUG`, `INVENTORY_DIR` | Reuses `devices.yml`. | +| `fresh-purged-app.sh` | Recreates `devices.yml` and deploys one or more apps twice with `ASYNC_ENABLED=false` and `ASYNC_ENABLED=true`. | `INFINITO_DISTRO`, `INVENTORY_DIR`, `TEST_DEPLOY_TYPE`, `APPS` | Baseline and recovery path. | diff --git a/scripts/tests/deploy/local/deploy/reuse-kept-all.sh b/scripts/tests/deploy/local/deploy/reuse-kept-all.sh index 44a9d70f4c..2be1d931de 100755 --- a/scripts/tests/deploy/local/deploy/reuse-kept-all.sh +++ b/scripts/tests/deploy/local/deploy/reuse-kept-all.sh @@ -13,7 +13,7 @@ set -euo pipefail # DEBUG (default: false) # # Notes: -# - This does NOT create the inventory. Run APPS= make deploy-fresh-kept-app first. +# - This does NOT create the inventory. Run APPS= make deploy-fresh-kept-apps first. # - We recompute the app list to keep behavior deterministic with filters. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -38,7 +38,7 @@ pw_file="${inv_dir}/.password" if [[ ! -f "${inv_file}" ]]; then echo "ERROR: inventory not found: ${inv_file}" >&2 - echo "Run: APPS= make deploy-fresh-kept-app" >&2 + echo "Run: APPS= make deploy-fresh-kept-apps" >&2 exit 2 fi diff --git a/scripts/tests/environment.sh b/scripts/tests/environment.sh index 29e00e7ce0..18b675728e 100755 --- a/scripts/tests/environment.sh +++ b/scripts/tests/environment.sh @@ -79,7 +79,7 @@ make test # Deploy dashboard with matomo disabled to verify that SERVICES_DISABLED suppresses # the shared service in the generated inventory. -SERVICES_DISABLED="matomo" make deploy-fresh-purged-app APPS="${DASHBOARD_APP}" +SERVICES_DISABLED="matomo" make deploy-fresh-purged-apps APPS="${DASHBOARD_APP}" # Trust the local CA certificate so HTTPS endpoints are reachable from the host. make trust-ca @@ -96,7 +96,7 @@ assert_http_status 404 "${MATOMO_URL}" # ============================================================================= # Deploy matomo so it becomes reachable via its dedicated inventory entry. -make deploy-fresh-purged-app APPS="${MATOMO_APP}" +make deploy-fresh-purged-apps APPS="${MATOMO_APP}" # Re-trust the CA after the fresh deploy rebuilt the certificates. make trust-ca @@ -104,7 +104,7 @@ make trust-ca # Verify matomo is now reachable after its dedicated deploy. assert_http_status 200 "${MATOMO_URL}" -# Verify the dashboard is no longer reachable. deploy-fresh-purged-app purges the +# Verify the dashboard is no longer reachable. deploy-fresh-purged-apps purges the # previous inventory and containers before deploying, so web-app-dashboard is gone # after the matomo-only deploy. nginx returns 404 for unconfigured upstreams. assert_http_status 404 "${DASHBOARD_URL}" @@ -113,7 +113,7 @@ assert_http_status 404 "${DASHBOARD_URL}" # Redeploy keeping inventory and apt packages — validates reuse of existing state. # ============================================================================= -make deploy-reuse-kept-app APPS="${MATOMO_APP}" +make deploy-reuse-kept-apps APPS="${MATOMO_APP}" # ============================================================================= # Teardown — shut down the stack and reverse all environment changes.