diff --git a/.github/workflows/test-deploy-local.yml b/.github/workflows/test-deploy-local.yml index db3d012bc1..b8cde4c8b8 100644 --- a/.github/workflows/test-deploy-local.yml +++ b/.github/workflows/test-deploy-local.yml @@ -27,7 +27,7 @@ permissions: # - For local `act`, prefer overriding via `--env`. # - For GitHub UI dispatch, inputs are used as fallback. env: - INFINITO_TEST_DEPLOY_TYPE: "server" + INFINITO_DEPLOY_TYPE: "server" INFINITO_DISTROS: "debian" NIX_CONFIG: "" INFINITO_IMAGE_TAG: "latest" @@ -123,7 +123,7 @@ jobs: - name: Deploy app (same as CI logic) shell: bash env: - INFINITO_TEST_DEPLOY_TYPE: ${{ needs.discover.outputs.test_deploy_type }} + INFINITO_DEPLOY_TYPE: ${{ needs.discover.outputs.test_deploy_type }} INFINITO_DISTROS: ${{ needs.discover.outputs.distros }} INFINITO_APPS: ${{ matrix.apps }} ANSIBLE_LOG_PATH: /tmp/ansible-${{ matrix.apps }}.log diff --git a/.github/workflows/test-deploy-server.yml b/.github/workflows/test-deploy-server.yml index d13bce4d8c..093b08d8f6 100644 --- a/.github/workflows/test-deploy-server.yml +++ b/.github/workflows/test-deploy-server.yml @@ -18,7 +18,7 @@ permissions: packages: read env: - INFINITO_TEST_DEPLOY_TYPE: server + INFINITO_DEPLOY_TYPE: server INFINITO_DISTROS: ${{ inputs.distros }} NIX_CONFIG: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-deploy-universal.yml b/.github/workflows/test-deploy-universal.yml index 541e498c33..238889e6a0 100644 --- a/.github/workflows/test-deploy-universal.yml +++ b/.github/workflows/test-deploy-universal.yml @@ -18,7 +18,7 @@ permissions: packages: read env: - INFINITO_TEST_DEPLOY_TYPE: universal + INFINITO_DEPLOY_TYPE: universal INFINITO_DISTROS: ${{ inputs.distros }} NIX_CONFIG: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-deploy-workstation.yml b/.github/workflows/test-deploy-workstation.yml index 9ec3b4c3ce..abf3ded6cb 100644 --- a/.github/workflows/test-deploy-workstation.yml +++ b/.github/workflows/test-deploy-workstation.yml @@ -18,7 +18,7 @@ permissions: packages: read env: - INFINITO_TEST_DEPLOY_TYPE: workstation + INFINITO_DEPLOY_TYPE: workstation INFINITO_DISTROS: ${{ inputs.distros }} NIX_CONFIG: | access-tokens = github.com=${{ secrets.GITHUB_TOKEN }} diff --git a/Makefile b/Makefile index c8f06e55ae..e0e18b2825 100644 --- a/Makefile +++ b/Makefile @@ -28,8 +28,7 @@ endif .PHONY: restart refresh exec run up down stop console .PHONY: build build-missing build-no-cache build-no-cache-all build-cleanup build-dependency .PHONY: act-all act-app act-workflow -.PHONY: deploy-fresh-kept-apps container-refresh-inventory deploy-reuse-kept-all container-purge-entity container-purge-system -.PHONY: deploy-fresh-purged-apps deploy-reuse-kept-apps deploy-reuse-purged-apps deploy-fresh-kept-all deploy-bundles redeploy-bundles +.PHONY: deploy container-refresh-inventory container-purge-entity container-purge-system .PHONY: bootstrap .PHONY: debug-network @@ -160,35 +159,16 @@ container-refresh-inventory: debug-network: @$(MAKE) exec INFINITO_CMD="python3 -m cli.contributing.network.diagnose" -# One-off deploy of all apps cumulated from one or more inventory bundles. Set INFINITO_FULL_CYCLE=true to also run the update pass (default: false). -deploy-bundles: - @bash scripts/tests/deploy/local/deploy/bundles/fresh.sh - -# Create a fresh inventory and deploy all apps. -deploy-fresh-kept-all: - @echo "=== local full deploy (type=$${INFINITO_TEST_DEPLOY_TYPE}, distro=$${INFINITO_DISTRO}) ===" - @bash scripts/tests/deploy/local/deploy/apps/initialize/all.sh - -# Create a fresh inventory and deploy one or more apps. -deploy-fresh-kept-apps: - @: "$${INFINITO_APPS:?INFINITO_APPS must be set (e.g. INFINITO_APPS=web-app-nextcloud)}" - @bash scripts/tests/deploy/local/deploy/apps/initialize/selection.sh "$${INFINITO_APPS}" - -# Deploy one or more apps with purged entities. Set INFINITO_FULL_CYCLE=true to also run the update pass. -deploy-fresh-purged-apps: - @bash scripts/tests/deploy/local/deploy/apps/reinstall/selection.sh - -# Redeploy all apps on an existing inventory. -deploy-reuse-kept-all: - @bash scripts/tests/deploy/local/deploy/apps/update/all.sh - -# Redeploy one or more apps on an existing inventory. -deploy-reuse-kept-apps: - @INFINITO_DEBUG=true bash scripts/tests/deploy/local/deploy/apps/update/selection.sh - -# Purge one or more app entities, then redeploy them on existing inventory. -deploy-reuse-purged-apps: container-purge-entity - @$(MAKE) deploy-reuse-kept-apps +# Run the local deploy router. Args: mode=initialize|reinstall|update (default initialize), apps=, purge=true|false (default false), type=server|workstation|universal (default from default.env), bundles=, disabled=, full_cycle=true|false. Example: `make deploy mode=reinstall apps=web-app-matomo full_cycle=true`. See scripts/tests/deploy/local/deploy/main.sh for the full table. +deploy: + @$(if $(apps),INFINITO_APPS="$(apps)") \ + $(if $(mode),INFINITO_DEPLOY_MODE="$(mode)") \ + $(if $(purge),INFINITO_PURGE_ENTITIES="$(purge)") \ + $(if $(type),INFINITO_DEPLOY_TYPE="$(type)") \ + $(if $(bundles),INFINITO_BUNDLES="$(bundles)") \ + $(if $(disabled),INFINITO_SERVICES_DISABLED="$(disabled)") \ + $(if $(full_cycle),INFINITO_FULL_CYCLE="$(full_cycle)") \ + bash scripts/tests/deploy/local/deploy/main.sh # Disable IPv6 for local development. disable-ipv6: @@ -324,9 +304,6 @@ list: mig: list tree @echo "Creating meta data for meta infinity graph" -# Redeploy all apps cumulated from inventory bundles on an existing inventory (no down/up, no entity purge; requires a prior deploy-bundles run). -redeploy-bundles: - @bash scripts/tests/deploy/local/deploy/bundles/update.sh # Refresh the running development stack only when it already exists. refresh: @bash scripts/system/network/docker/stack_refresh.sh diff --git a/default.env b/default.env index e77ffe7551..755e15b04a 100644 --- a/default.env +++ b/default.env @@ -88,6 +88,9 @@ INFINITO_CPUS=0 # Truthy enables debug behavior in the local deploy flows. INFINITO_DEBUG= +# Deployment matrix target: server | workstation | universal. +INFINITO_DEPLOY_TYPE=server + # Distro the build/test matrix is currently iterating over (generator may override). INFINITO_DISTRO=debian @@ -181,9 +184,6 @@ INFINITO_SRC_DIR=/opt/src/infinito # CIDR of the internal docker bridge used by the compose stack. INFINITO_SUBNET=172.30.0.0/24 -# Deployment matrix target: server | workstation | universal. -INFINITO_TEST_DEPLOY_TYPE=server - # Glob `unittest discover -p` applies when running the test suites. INFINITO_TEST_PATTERN=test*.py diff --git a/docs/agents/action/iteration/playwright.md b/docs/agents/action/iteration/playwright.md index d78c1cc8ee..4873571e85 100644 --- a/docs/agents/action/iteration/playwright.md +++ b/docs/agents/action/iteration/playwright.md @@ -6,7 +6,7 @@ This page defines the inner loop for iterating on a role-local `files/playwright - **Inner loop**: the edit-rerun cycle on `roles//files/playwright/playwright.spec.js` driven by `scripts/tests/e2e/rerun-spec.sh`, without a redeploy. - **Staging dir**: `TEST_E2E_PLAYWRIGHT_STAGE_BASE_DIR/` (default `/tmp/test-e2e-playwright/`). Contains the rendered `.env` and the Playwright project from the last deploy. -- **Baseline deploy**: a successful `make deploy-fresh-purged-apps INFINITO_APPS= INFINITO_FULL_CYCLE=true` run as defined in [Role Loop](role.md). +- **Baseline deploy**: a successful `make deploy mode=reinstall apps= full_cycle=true` run as defined in [Role Loop](role.md). - **Pass**: `scripts/tests/e2e/rerun-spec.sh ` exits `0` AND every MUST in [Contributing `playwright.spec.js`](../../../contributing/artefact/files/role/playwright.specs.js.md) holds for the resulting run. ## Preconditions @@ -54,13 +54,13 @@ You MUST NOT report the task complete until all of the following hold: 1. `scripts/tests/e2e/rerun-spec.sh ` has exited `0` on the current spec. 2. Every MUST in [Contributing `playwright.spec.js`](../../../contributing/artefact/files/role/playwright.specs.js.md) holds, including the live-application assertion and the logged-out final state. -3. A final `make deploy-fresh-purged-apps INFINITO_APPS= INFINITO_FULL_CYCLE=true` run has completed with the spec passing against the freshly provisioned stack. Inner-loop passes alone do NOT satisfy this gate. +3. A final `make deploy mode=reinstall apps= full_cycle=true` run has completed with the spec passing against the freshly provisioned stack. Inner-loop passes alone do NOT satisfy this gate. ## Escape When the failure requires a change outside `files/playwright/playwright.spec.js`: 1. You MUST stop the inner loop. Inner-loop runs do NOT pick up role changes. -2. You SHOULD run `make deploy-reuse-kept-apps INFINITO_APPS=` for the redeploy. -3. You MUST NOT fall back to `make deploy-fresh-purged-apps INFINITO_APPS= INFINITO_FULL_CYCLE=true` unless the reuse path has concrete evidence of a broken inventory or host stack, per [Role Loop](role.md). +2. You SHOULD run `make deploy mode=update apps=` for the redeploy. +3. You MUST NOT fall back to `make deploy mode=reinstall apps= full_cycle=true` unless the reuse path has concrete evidence of a broken inventory or host stack, per [Role Loop](role.md). 4. After the redeploy succeeds, return to [Procedure](#procedure) step 1. diff --git a/docs/agents/action/iteration/role.md b/docs/agents/action/iteration/role.md index 60954e91f6..d12c61b83a 100644 --- a/docs/agents/action/iteration/role.md +++ b/docs/agents/action/iteration/role.md @@ -17,17 +17,17 @@ For workflow-level iteration with Act, see [Workflow Loop](workflow.md). - SIDE EFFECT (yes): inventory initializer auto-removes the provider roles `web-app-matomo`, `web-app-dashboard`, `web-app-prometheus`, `web-app-mailu`, and `web-svc-css`. Do NOT list them in `INFINITO_APPS`. - PERSIST: record answer at top of iteration. Reuse for all subsequent deploys without re-asking. - You MUST run `make test` before every deploy. Only proceed with the deploy if all tests pass. -- You MUST prepend `INFINITO_PLAYWRIGHT_KEEP=true` to every `make deploy-*` command in the iteration (fresh, reuse-kept, and reuse-purged alike), so trace, screenshot, and video of passing Playwright tests stay inspectable. Omit only when the user has explicitly opted out of per-test artefacts. For the full propagation chain see [Playwright Tests](../../../contributing/actions/testing/playwright.md#artefact-retention-). -- Unless the user explicitly says to reuse the existing setup, you MUST start once with `make deploy-fresh-purged-apps INFINITO_APPS= INFINITO_FULL_CYCLE=true` to establish the baseline inventory and clean app state. `INFINITO_FULL_CYCLE=true` adds the async update pass (pass 2) and MUST stay on unless the user explicitly asks to skip it. +- You MUST prepend `INFINITO_PLAYWRIGHT_KEEP=true` to every `make deploy` command in the iteration (any mode), so trace, screenshot, and video of passing Playwright tests stay inspectable. Omit only when the user has explicitly opted out of per-test artefacts. For the full propagation chain see [Playwright Tests](../../../contributing/actions/testing/playwright.md#artefact-retention-). +- Unless the user explicitly says to reuse the existing setup, you MUST start once with `make deploy mode=reinstall apps= full_cycle=true` to establish the baseline inventory and clean app state. `full_cycle=true` adds the async update pass (pass 2) and MUST stay on unless the user explicitly asks to skip it. - You MUST NOT run more than one deploy command at the same time. Deployments MUST be executed serially, never in parallel. -- To speed up debugging, you MAY pass multiple apps at once, e.g. `make deploy-fresh-purged-apps INFINITO_APPS=" " INFINITO_FULL_CYCLE=true`. -- After that, you MUST use `make deploy-reuse-kept-apps INFINITO_APPS=` for the default edit-fix-redeploy loop. -- Do NOT rerun `make deploy-fresh-purged-apps INFINITO_APPS= INFINITO_FULL_CYCLE=true` 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 `make deploy-reuse-purged-apps INFINITO_APPS=` once. -- After that targeted purge check, you MUST return to `make deploy-reuse-kept-apps INFINITO_APPS=`. -- Only go back to `make deploy-fresh-purged-apps INFINITO_APPS= INFINITO_FULL_CYCLE=true` if you have concrete evidence that the inventory or host stack is broken, or you intentionally need a fresh single-app baseline again. -- Network or DNS failures during a local deploy count as concrete evidence that the host stack is broken. In that case, the next retry MUST be `make deploy-fresh-purged-apps INFINITO_APPS= INFINITO_FULL_CYCLE=true`. -- If you need to validate the single-app init/deploy path separately, use `make deploy-fresh-kept-apps INFINITO_APPS=`. +- To speed up debugging, you MAY pass multiple apps at once, e.g. `make deploy mode=reinstall apps=" " full_cycle=true`. +- After that, you MUST use `make deploy mode=update apps=` for the default edit-fix-redeploy loop. +- Do NOT rerun `make deploy mode=reinstall apps= full_cycle=true` 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 `make deploy mode=update apps= purge=true` once. +- After that targeted purge check, you MUST return to `make deploy mode=update apps=`. +- Only go back to `make deploy mode=reinstall apps= full_cycle=true` if you have concrete evidence that the inventory or host stack is broken, or you intentionally need a fresh single-app baseline again. +- Network or DNS failures during a local deploy count as concrete evidence that the host stack is broken. In that case, the next retry MUST be `make deploy mode=reinstall apps= full_cycle=true`. +- If you need to validate the single-app init/deploy path separately, use `make deploy apps=`. ## Matrix variants @@ -35,8 +35,8 @@ For the matrix-variant mechanism (folder layout, round semantics, `--variant` / - Before you start a Role Loop on a matrix-variant role, you MUST decide if the iteration targets the FULL matrix (validates every variant) or ONE specific variant (focused debug). State the choice explicitly before the first deploy. - For focused debug on variant ``, you MUST pin `INFINITO_VARIANT=` on every command in the iteration. Mixing pinned and unpinned commands silently retargets a different folder. -- Default focused-debug recipe: `INFINITO_VARIANT= make deploy-fresh-purged-apps INFINITO_APPS= INFINITO_FULL_CYCLE=true` once for the variant baseline, then `INFINITO_VARIANT= make deploy-reuse-kept-apps INFINITO_APPS=` for the edit-fix-redeploy loop. -- First contact with a previously-untouched `INFINITO_VARIANT=` MUST be `make deploy-fresh-purged-apps INFINITO_APPS= INFINITO_VARIANT=`, never a reuse target. Reuse re-pins the live stack onto stale volumes, DB rows and network aliases from the previously-pinned variant, producing split-brain app state. +- Default focused-debug recipe: `INFINITO_VARIANT= make deploy mode=reinstall apps= full_cycle=true` once for the variant baseline, then `INFINITO_VARIANT= make deploy mode=update apps=` for the edit-fix-redeploy loop. +- First contact with a previously-untouched `INFINITO_VARIANT=` MUST be `make deploy mode=reinstall apps= INFINITO_VARIANT=`, never a reuse target. Reuse re-pins the live stack onto stale volumes, DB rows and network aliases from the previously-pinned variant, producing split-brain app state. - If a reuse target aborts with "inventory not found", you MUST add `INFINITO_VARIANT=` and re-run; do NOT work around the error by re-creating the unsuffixed folder by hand. - For FULL-matrix iteration, omit `INFINITO_VARIANT=`. If any round fails, capture WHICH round was the last successful one so the next redeploy can pin `INFINITO_VARIANT=` to it. - When debugging cross-variant interaction (for example "the multisite variant breaks because single-site state was not purged"), reproduce with the FULL matrix once, then pin `INFINITO_VARIANT=` and iterate the fix. Re-run the FULL matrix only when you believe the fix is complete. diff --git a/docs/changelog/003.000.000-2026-02-11.md b/docs/changelog/003.000.000-2026-02-11.md index 4e1dc5b45b..492d48fa3e 100644 --- a/docs/changelog/003.000.000-2026-02-11.md +++ b/docs/changelog/003.000.000-2026-02-11.md @@ -4,7 +4,7 @@ * **🚨 Breaking Changes** * Deployment type flag removed - The CLI flag *-T / INFINITO_TEST_DEPLOY_TYPE* has been removed. Deployment types are now derived automatically from invokable role rules. + The CLI flag *-T / INFINITO_DEPLOY_TYPE* has been removed. Deployment types are now derived automatically from invokable role rules. * Universal stage execution removed Universal roles are no longer executed as a separate lifecycle stage. They are handled exclusively via constructor and destructor stages. This prevents duplicate executions but changes lifecycle behavior. * Removed CLI flags diff --git a/docs/contributing/actions/deploy.md b/docs/contributing/actions/deploy.md index 2476fbc1be..a117c1374f 100644 --- a/docs/contributing/actions/deploy.md +++ b/docs/contributing/actions/deploy.md @@ -8,21 +8,21 @@ Two layers exist for invoking a local deploy: | Layer | When to use | |---|---| -| `make deploy-*` targets in the [Makefile](../../../Makefile) | Default. Stable, opinionated wrappers tuned for the local-dev / CI-on-laptop flow. | -| `infinito administration deploy development ` (Python CLI) | Direct invocation when you need a flag the make targets do not expose, or when you script multi-step flows yourself. | +| `make deploy` in the [Makefile](../../../Makefile) | Default. Single entry point with short Make variables (`apps`, `mode`, `purge`, `type`) routed by [main.sh](../../../scripts/tests/deploy/local/deploy/main.sh). | +| `infinito administration deploy development ` (Python CLI) | Direct invocation when you need a flag the make target does not expose, or when you script multi-step flows yourself. | -The make targets ultimately call the same CLI, so any behaviour described here applies to both. +The make target ultimately calls the same CLI, so any behaviour described here applies to both. ## First-Run Baseline 📦 -Use `deploy-fresh-purged-apps` to bring up a clean slate: +Use `mode=reinstall` to bring up a clean slate (cycles the dev stack and purges shared entities first): ```bash -make deploy-fresh-purged-apps INFINITO_APPS=" " INFINITO_FULL_CYCLE=true +make deploy mode=reinstall apps=" " full_cycle=true ``` -- `INFINITO_FULL_CYCLE=true` adds the async update pass (pass 2) and SHOULD stay on for the baseline. The behaviour, per-variant interleaving, and `--full-cycle` flag mechanics are documented in [variants.md](../design/variants.md). -- The wrapper runs init, then deploy. Init materialises the inventory under `${INFINITO_INVENTORY_DIR}` (resolved by `make dotenv` via [resolve.sh](../../../scripts/inventory/resolve.sh); see [variables.md](../environment/variables.md)). +- `full_cycle=true` adds the async update pass (pass 2) and SHOULD stay on for the baseline. The behaviour, per-variant interleaving, and `--full-cycle` flag mechanics are documented in [variants.md](../design/variants.md). +- The router runs init, then deploy. Init materialises the inventory under `${INFINITO_INVENTORY_DIR}` (resolved by `make dotenv` via [resolve.sh](../../../scripts/inventory/resolve.sh); see [variables.md](../environment/variables.md)). - For roles with a `roles//meta/variants.yml` the init step produces one inventory folder per variant; the deploy step iterates them. Folder layout, round semantics, cleanup rules, and the link to the file-format reference live in [variants.md](../design/variants.md). ## Edit / Fix / Redeploy Loop 🔁 @@ -30,7 +30,7 @@ make deploy-fresh-purged-apps INFINITO_APPS=" " INFINITO_FULL_CYCLE= Default redeploy after a local code change: ```bash -make deploy-reuse-kept-apps INFINITO_APPS="" +make deploy mode=update apps="" ``` - Reuses the existing inventory, keeps app state, runs the deploy only. @@ -39,23 +39,23 @@ make deploy-reuse-kept-apps INFINITO_APPS="" If the reuse path keeps reproducing the same failure and you want to test whether app entity state is involved: ```bash -make deploy-reuse-purged-apps INFINITO_APPS="" +make deploy mode=update apps="" purge=true ``` -This purges the app's containers + volumes + Ansible-managed state on the host, then re-deploys. Use it once, then return to `deploy-reuse-kept-apps`. Do NOT loop on `deploy-reuse-purged-apps`; if the failure survives a single purge it is not a state issue. +This purges the app's containers + volumes + Ansible-managed state on the host, then re-deploys. Use it once, then return to `mode=update` without `purge=true`. Do NOT loop with `purge=true`; if the failure survives a single purge it is not a state issue. -Only return to `deploy-fresh-purged-apps` when you have concrete evidence that the inventory or the host stack itself is broken (for example DNS or network failures during the deploy). +Only return to `mode=reinstall` when you have concrete evidence that the inventory or the host stack itself is broken (for example DNS or network failures during the deploy). ## Pinning A Single Variant 🎯 -For multi-variant roles you MAY restrict any of the make targets above (and the dev CLI subcommands) to a single matrix round by setting `INFINITO_VARIANT=`: +For multi-variant roles you MAY restrict any of the `make deploy` invocations above (and the dev CLI subcommands) to a single matrix round by setting `INFINITO_VARIANT=`: ```bash # Variant 1 baseline only (no full matrix): -INFINITO_VARIANT=1 make deploy-fresh-purged-apps INFINITO_APPS="" INFINITO_FULL_CYCLE=true +INFINITO_VARIANT=1 make deploy mode=reinstall apps="" full_cycle=true # Edit-fix-redeploy loop pinned to that variant: -INFINITO_VARIANT=1 make deploy-reuse-kept-apps INFINITO_APPS="" +INFINITO_VARIANT=1 make deploy mode=update apps="" ``` Pinning is sticky: when iterating with `INFINITO_VARIANT=`, you MUST set it on every command in the iteration. Mixing pinned and unpinned commands silently retargets a different folder. The full semantics (single-folder mode, no inter-round cleanup, out-of-range error) live in [variants.md](../design/variants.md). @@ -83,7 +83,7 @@ For TLS-enabled local sites, run [`make trust-ca`](../../../Makefile) once after | File | Purpose | |---|---| -| [Makefile](../../../Makefile) | All `deploy-*` and `make exec` / `make trust-ca` targets. | +| [Makefile](../../../Makefile) | The `deploy` router target and `make exec` / `make trust-ca` helpers. | | [dev CLI tree](../../../cli/administration/deploy/development/) | Python CLI for init, deploy, up, down, exec, etc. | | [`make dotenv`](../../../Makefile) | Resolves `INFINITO_INVENTORY_DIR`, `INFINITO_INVENTORY_FILE`, and `INFINITO_INVENTORY_VARS_FILE` into `.env` for the dev CLI (see [variables.md](../environment/variables.md)). | | [local deploy scripts](../../../scripts/tests/deploy/local/) | Bash glue behind the make targets (fresh / reuse / purge variants). | diff --git a/docs/contributing/actions/testing.md b/docs/contributing/actions/testing.md index 60a50b9ab7..f882d1a1d7 100644 --- a/docs/contributing/actions/testing.md +++ b/docs/contributing/actions/testing.md @@ -38,13 +38,13 @@ Use the following table when you need realistic local deployment validation or a | Category | Command | What it does | When to use it | |---|---|---|---| -| Local deploy | `make deploy-fresh-kept-apps INFINITO_APPS=web-app-nextcloud` | Creates the needed inventory and deploys one or more apps. | Fresh deploy for a specific app set. | -| Local deploy | `make deploy-reuse-kept-apps INFINITO_APPS=web-app-nextcloud` | Reuses an existing `devices.yml` inventory and redeploys one or more apps quickly. | Fast reuse path. | -| Local deploy | `make deploy-reuse-purged-apps INFINITO_APPS=web-app-nextcloud` | 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 | `make deploy-fresh-purged-apps INFINITO_APPS=web-app-matomo` | 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. | -| Bundle deploy | `INFINITO_BUNDLES="[,]" make deploy-bundles` | Aggregates the role groups from one or more [inventories/bundles/](../../../inventories/bundles/) entries into `INFINITO_APPS` and runs the fresh-purged deploy. Set `INFINITO_FULL_CYCLE=true` for the async update pass. | One-shot validation of a curated app shape (e.g. `education-suite`). | -| Bundle redeploy | `INFINITO_BUNDLES="[,]" make redeploy-bundles` | Same bundle resolution as `deploy-bundles`, but routes through the reuse-kept path (no down/up, no entity purge). | Fast iteration loop after a prior `deploy-bundles` run. | +| Local deploy | `make deploy apps=web-app-nextcloud` | Creates the needed inventory and deploys one or more apps. | Fresh deploy for a specific app set. | +| Local deploy | `make deploy mode=update apps=web-app-nextcloud` | Reuses an existing `devices.yml` inventory and redeploys one or more apps quickly. | Fast reuse path. | +| Local deploy | `make deploy mode=update apps=web-app-nextcloud purge=true` | 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 | `make deploy mode=reinstall apps=web-app-matomo` | Runs a dedicated local validation flow for one or more apps against the dev stack, cycling the stack and re-initializing the inventory first. | Baseline and recovery path. | +| Full local validation | `make deploy` | Builds the broader local deployment flow across apps. | Broad coverage when you explicitly need it. | +| Bundle deploy | `make deploy bundles="[,]"` | Aggregates the role groups from one or more [inventories/bundles/](../../../inventories/bundles/) entries into `INFINITO_APPS` and runs the reinstall flow. Set `full_cycle=true` for the async update pass. | One-shot validation of a curated app shape (e.g. `education-suite`). | +| Bundle redeploy | `make deploy mode=update bundles="[,]"` | Same bundle resolution as the bundle deploy, but routes through the reuse path (no down/up, no entity purge). | Fast iteration loop after a prior bundle deploy. | | 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/actions/testing/playwright.md b/docs/contributing/actions/testing/playwright.md index a282045bc0..a93a18dd38 100644 --- a/docs/contributing/actions/testing/playwright.md +++ b/docs/contributing/actions/testing/playwright.md @@ -11,7 +11,7 @@ For what the `files/playwright/playwright.spec.js` of a role MUST contain, see - [Playwright](https://playwright.dev/) runs inside Docker via the shared `test-e2e-playwright` role. - There is no standalone `make` target for Playwright. Tests run as part of local deploy flows - (e.g. `make deploy-fresh-purged-apps INFINITO_APPS=web-app-matomo INFINITO_FULL_CYCLE=true`). For spec-only + (e.g. `make deploy mode=reinstall apps=web-app-matomo full_cycle=true`). For spec-only iteration after the first successful deploy, see [Playwright Spec Loop](../../../agents/action/iteration/playwright.md). ## When to Write ✍️ diff --git a/docs/contributing/design/role/services/lifecycle.md b/docs/contributing/design/role/services/lifecycle.md index 1d55f90fb7..e620568f89 100644 --- a/docs/contributing/design/role/services/lifecycle.md +++ b/docs/contributing/design/role/services/lifecycle.md @@ -59,7 +59,7 @@ The role deploys end-to-end on the project's reference distribution and is cover A role tagged `alpha`: -- MUST deploy cleanly via `make deploy-fresh-purged-apps` against the reference distribution. +- MUST deploy cleanly via `make deploy mode=reinstall` against the reference distribution. - MUST ship `templates/playwright.env.j2` and `files/playwright/playwright.spec.js`, with at least one assertion that covers the role's canonical landing surface. - MUST be exercised by the matrix-deploy on every push. - MAY have known minor issues documented in its `README.md` or in an open issue. diff --git a/docs/contributing/design/variants.md b/docs/contributing/design/variants.md index e26b3513af..9f4b739442 100644 --- a/docs/contributing/design/variants.md +++ b/docs/contributing/design/variants.md @@ -15,8 +15,8 @@ The development deploy CLI uses a **folder-per-round model** that splits cleanly 3. **Inventory folders.** [init.py](../../../cli/administration/deploy/development/init.py) calls [build_dev_inventory_matrix](../../../cli/administration/deploy/development/inventory/builder.py), which creates one folder per round at `-` (or just `` when there is a single round). For each folder, `build_dev_inventory` resolves the round's per-app variant payload and bakes it into the inventory's `host_vars` as `applications.: ` overrides. The inventory is therefore variant-resolved on disk; no runtime selector is needed. 4. **Deploy iteration.** [deploy.py](../../../cli/administration/deploy/development/deploy.py) re-derives the same plan via `plan_dev_inventory_matrix` (the planner is a pure function shared between init and deploy) and runs one deploy per folder. **Every round deploys its full variant-aware include set.** Round R starts from a clean host (the previous round's include is purged before round R begins, see point 5), so every dep round R needs MUST be redeployed. 5. **Cleanup between rounds.** Before each non-first iteration the wrapper runs [entity.sh](../../../scripts/tests/deploy/local/purge/entity.sh) for **every** app in the previous round's include set. The next round therefore boots from an empty host, which guarantees cross-round state coherence: nothing the previous round deployed (whether it stays in the current round's closure or falls out) can leak into round R, so variants are free to disagree on which deps they pull in. The final round is followed by no purge so the last state remains available for inspection or follow-up specs. -6. **`--full-cycle` (async update pass).** When set (or `INFINITO_FULL_CYCLE=true` in the environment), the wrapper runs each round's deploy TWICE: first the regular sync pass, then immediately a second pass with `-e ASYNC_ENABLED=true` overriding the host_var, against the SAME variant's folder, BEFORE moving to the next round. The two passes are therefore always co-located on the same host state; the async pass never accidentally targets a host that a previous round's variant left behind. -7. **Pinning to a single round.** Both init and deploy accept `--variant ` (or read the `INFINITO_VARIANT` environment variable) to pin operations to a single round's folder. In single-round mode no inter-round cleanup runs, since there is no previous round to diff against. The `make deploy-reuse-*` targets honour the same `INFINITO_VARIANT` env-var by suffixing `INFINITO_INVENTORY_DIR` / `INFINITO_INVENTORY_FILE` to `-`, so a redeploy can target one specific variant without iterating the full matrix. +6. **`--full-cycle` (async update pass).** When set (or `full_cycle=true` on `make deploy`, or `INFINITO_FULL_CYCLE=true` in the environment), the wrapper runs each round's deploy TWICE: first the regular sync pass, then immediately a second pass with `-e ASYNC_ENABLED=true` overriding the host_var, against the SAME variant's folder, BEFORE moving to the next round. The two passes are therefore always co-located on the same host state; the async pass never accidentally targets a host that a previous round's variant left behind. +7. **Pinning to a single round.** Both init and deploy accept `--variant ` (or read the `INFINITO_VARIANT` environment variable) to pin operations to a single round's folder. In single-round mode no inter-round cleanup runs, since there is no previous round to diff against. The `make deploy mode=update` flows honour the same `INFINITO_VARIANT` env-var by suffixing `INFINITO_INVENTORY_DIR` / `INFINITO_INVENTORY_FILE` to `-`, so a redeploy can target one specific variant without iterating the full matrix. The in-play loader (`utils.cache.applications.get_merged_applications`) always uses variant 0 as the default and lets the inventory's `applications.` overrides win via deep merge: the inventory itself is the source of truth for what variant a round runs against. diff --git a/docs/contributing/environment/hardware.md b/docs/contributing/environment/hardware.md index 2b5d446c25..1c69c45cbd 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 `INFINITO_SERVICES_DISABLED` environment variable before creating the inventory to disable services automatically across all applications without editing any file: ```bash -make deploy-fresh-purged-apps INFINITO_APPS=web-app-discourse INFINITO_SERVICES_DISABLED="matomo" +make deploy mode=reinstall apps=web-app-discourse disabled=matomo ``` This sets `enabled: false` and `shared: false` for every listed service in the generated inventory. See [variables.md](variables.md) for details. @@ -73,16 +73,16 @@ On small machines, you SHOULD limit validation to the role you are touching. For Discourse, start with: ```bash -make deploy-fresh-purged-apps INFINITO_APPS=web-app-discourse INFINITO_SERVICES_DISABLED="matomo" +make deploy mode=reinstall apps=web-app-discourse disabled=matomo ``` If the local inventory and stack already exist, you SHOULD reuse them: ```bash -make deploy-reuse-kept-apps INFINITO_APPS=web-app-discourse INFINITO_SERVICES_DISABLED="matomo" +make deploy mode=update apps=web-app-discourse disabled=matomo ``` -You SHOULD use `make deploy-fresh-kept-all` only when you need broad coverage and have enough time and resources. +You SHOULD use `make deploy` (full discovery) only when you need broad coverage and have enough time and resources. ## Measure Before You Delete diff --git a/docs/contributing/environment/setup.md b/docs/contributing/environment/setup.md index 714f379e0f..3ef33d0f85 100644 --- a/docs/contributing/environment/setup.md +++ b/docs/contributing/environment/setup.md @@ -70,7 +70,7 @@ The repository already contains a modular environment test suite at [scripts/tes | 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 | `make deploy-fresh-purged-apps INFINITO_APPS=web-app-matomo` | Runs the baseline validation path for one concrete app. For the retry-loop policy, see [Role Loop](../../agents/action/iteration/role.md). | +| 5 | `make deploy mode=reinstall apps=web-app-matomo` | Runs the baseline validation path for one concrete app. For the retry-loop policy, see [Role Loop](../../agents/action/iteration/role.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/inventories/bundles/README.md b/inventories/bundles/README.md index 34d9bc9bb1..f87858cd0f 100644 --- a/inventories/bundles/README.md +++ b/inventories/bundles/README.md @@ -169,17 +169,17 @@ The inventory itself is the bundle. ## Deploying a Bundle -Two `make` targets resolve one or more bundles into the role groups declared under `all.children` and feed them into the standard local deploy flow. The resolver is [`utils.inventory.bundle_apps`](../../utils/inventory/bundle_apps.py); it deduplicates across bundles and preserves declaration order. +The single `make deploy` target resolves one or more bundles into the role groups declared under `all.children` and feeds them into the standard local deploy flow when `bundles=` (or `INFINITO_BUNDLES=` in the environment) is set. The resolver is [`utils.inventory.bundle_apps`](../../utils/inventory/bundle_apps.py); it deduplicates across bundles and preserves declaration order. | Command | Path | Behavior | |---|---|---| -| `INFINITO_BUNDLES="[,]" make deploy-bundles` | fresh-purged | Brings the stack down/up, purges entities, then deploys every role group from the listed bundles. Set `INFINITO_FULL_CYCLE=true` to also run the async update pass. | -| `INFINITO_BUNDLES="[,]" make redeploy-bundles` | reuse-kept | No down/up, no entity purge. Requires a prior `deploy-bundles` run that initialized the inventory. | +| `make deploy bundles="[,]"` | reinstall | Brings the stack down/up, purges entities, then deploys every role group from the listed bundles. Set `full_cycle=true` to also run the async update pass. | +| `make deploy mode=update bundles="[,]"` | update | No down/up, no entity purge. Requires a prior initialize/reinstall run that materialized the inventory. | Example: ```bash -INFINITO_BUNDLES="education-suite,startup-essentials" make deploy-bundles INFINITO_FULL_CYCLE=true +make deploy bundles="education-suite,startup-essentials" full_cycle=true ``` See [docs/contributing/tools/make.md](../../docs/contributing/tools/make.md) and [docs/contributing/actions/testing.md](../../docs/contributing/actions/testing.md) for the full deploy-target reference. diff --git a/roles/web-app-hugo/Administration.md b/roles/web-app-hugo/Administration.md index ae9ca89322..4d0214de42 100644 --- a/roles/web-app-hugo/Administration.md +++ b/roles/web-app-hugo/Administration.md @@ -11,7 +11,7 @@ The Hugo site is built into the custom Docker image at `compose build` time. The make exec INFINITO_CMD="docker compose -f /opt/docker/web-app-hugo/docker-compose.yml build --no-cache" ``` - The next `make deploy-reuse-kept-apps INFINITO_APPS=web-app-hugo` will pull the image, restart nginx, and serve the freshly rendered output. + The next `make deploy mode=update apps=web-app-hugo` will pull the image, restart nginx, and serve the freshly rendered output. ## Bumping the source version @@ -26,7 +26,7 @@ The Hugo site is built into the custom Docker image at `compose build` time. The 3. Re-deploy: ```bash - make deploy-reuse-kept-apps INFINITO_APPS=web-app-hugo + make deploy mode=update apps=web-app-hugo ``` 4. Verify in the browser that the content reflects the new version. diff --git a/roles/web-app-keycloak/TODO.md b/roles/web-app-keycloak/TODO.md index ffe88415c0..95812fd152 100644 --- a/roles/web-app-keycloak/TODO.md +++ b/roles/web-app-keycloak/TODO.md @@ -5,7 +5,7 @@ ## Req 019 rollout: deploy gate -- During the autonomous req 019 rollout, `make deploy-fresh-purged-apps INFINITO_APPS=web-app-keycloak INFINITO_FULL_CYCLE=true` failed with two unrelated assertions: +- During the autonomous req 019 rollout, `make deploy mode=reinstall apps=web-app-keycloak full_cycle=true` failed with two unrelated assertions: - `kcadm.sh config credentials` failed during the keycloak admin login phase (likely transient or env-scoped). - `run_once_web_app_mailu is defined` assertion failed in `sys-svc-mail`, indicating the service-loader did not preload Mailu in the keycloak-only deploy path. - These are deployment-orchestration failures, not playwright-parity failures, and were therefore deferred per the [autonomy escape clause](../../docs/requirements/019-playwright-meta-services-parity.md#autonomy). diff --git a/roles/web-app-odoo/README.md b/roles/web-app-odoo/README.md index a569f3311a..7779cc50d5 100644 --- a/roles/web-app-odoo/README.md +++ b/roles/web-app-odoo/README.md @@ -65,13 +65,13 @@ Additional modules can be enabled via the `modules.optional` configuration in th Deploy Odoo using the standard Infinito.Nexus deployment command: ```bash -INFINITO_APPS=web-app-odoo make deploy-fresh-purged-apps +make deploy mode=reinstall apps=web-app-odoo ``` For subsequent updates: ```bash -INFINITO_APPS=web-app-odoo make deploy-reuse-kept-apps +make deploy mode=update apps=web-app-odoo ``` ## Access diff --git a/scripts/github/resolve/output_apps.sh b/scripts/github/resolve/output_apps.sh index b12dc26700..0d89699a94 100755 --- a/scripts/github/resolve/output_apps.sh +++ b/scripts/github/resolve/output_apps.sh @@ -2,7 +2,7 @@ # # Resolve the app list and write it to GITHUB_OUTPUT. # Inputs via env (forwarded to scripts/meta/resolve/apps.sh): -# INFINITO_TEST_DEPLOY_TYPE — required (server|workstation|universal) +# INFINITO_DEPLOY_TYPE — required (server|workstation|universal) # INFINITO_WHITELIST — optional space-separated allowlist set -euo pipefail diff --git a/scripts/meta/resolve/apps.sh b/scripts/meta/resolve/apps.sh index b36be75264..ff3b265f2b 100755 --- a/scripts/meta/resolve/apps.sh +++ b/scripts/meta/resolve/apps.sh @@ -5,13 +5,13 @@ set -euo pipefail # optionally filtered by lifecycle and CI storage constraints. # # Inputs via env: -# INFINITO_TEST_DEPLOY_TYPE = server|workstation|universal (required) +# INFINITO_DEPLOY_TYPE = server|workstation|universal (required) # INFINITO_WHITELIST = optional space-separated list of app ids to keep # # Output: # JSON array to stdout (single line, always valid) -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE is required (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE is required (server|workstation|universal)}" PYTHON="${PYTHON:-python3}" @@ -92,7 +92,7 @@ apps_json="$( run_meta_cli \ -m cli.meta.roles.applications.type \ --format json \ - --type "${INFINITO_TEST_DEPLOY_TYPE}" \ + --type "${INFINITO_DEPLOY_TYPE}" \ "${lifecycles_args[@]}" | json_compact_array )" diff --git a/scripts/meta/resolve/input.sh b/scripts/meta/resolve/input.sh index 892814e9fe..05dd38907b 100755 --- a/scripts/meta/resolve/input.sh +++ b/scripts/meta/resolve/input.sh @@ -4,7 +4,7 @@ set -euo pipefail # Resolve effective workflow parameters (STRICT MODE) # # Required: -# INFINITO_TEST_DEPLOY_TYPE (server|workstation|universal) +# INFINITO_DEPLOY_TYPE (server|workstation|universal) # INFINITO_DISTROS (space-separated distro list, e.g. "arch debian") # # Always defined: @@ -16,7 +16,7 @@ set -euo pipefail # # Writes: # - to $GITHUB_OUTPUT: test_deploy_type, distros, whitelist -# - to $GITHUB_ENV: INFINITO_TEST_DEPLOY_TYPE, INFINITO_DISTROS, INFINITO_WHITELIST +# - to $GITHUB_ENV: INFINITO_DEPLOY_TYPE, INFINITO_DISTROS, INFINITO_WHITELIST : "${GITHUB_OUTPUT:?GITHUB_OUTPUT must be set (running inside GitHub Actions or act)}" : "${GITHUB_ENV:?GITHUB_ENV must be set (running inside GitHub Actions or act)}" @@ -25,41 +25,41 @@ set -euo pipefail # 1) real env # 2) workflow inputs (passed via env by workflow step) # Script runs in GHA workflow context where .env is not loaded; the INPUT_* fallback IS the SPOT here. -INFINITO_TEST_DEPLOY_TYPE="${INFINITO_TEST_DEPLOY_TYPE:-${INPUT_TEST_DEPLOY_TYPE:-}}" # nocheck: gha-input-bridge -INFINITO_DISTROS="${INFINITO_DISTROS:-${INPUT_DISTROS:-}}" # nocheck: gha-input-bridge +INFINITO_DEPLOY_TYPE="${INFINITO_DEPLOY_TYPE:-${INPUT_TEST_DEPLOY_TYPE:-}}" # nocheck: gha-input-bridge +INFINITO_DISTROS="${INFINITO_DISTROS:-${INPUT_DISTROS:-}}" # nocheck: gha-input-bridge # INFINITO_WHITELIST must always exist, but may be empty INFINITO_WHITELIST="${INFINITO_WHITELIST:-${INPUT_WHITELIST:-}}" # nocheck: gha-input-bridge INFINITO_WHITELIST="${INFINITO_WHITELIST:-}" # force defined even if still empty # Hard requirements -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE must be set (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE must be set (server|workstation|universal)}" : "${INFINITO_DISTROS:?INFINITO_DISTROS must be set (e.g. \"arch debian ubuntu\")}" -case "${INFINITO_TEST_DEPLOY_TYPE}" in +case "${INFINITO_DEPLOY_TYPE}" in server | workstation | universal) ;; *) - echo "Invalid INFINITO_TEST_DEPLOY_TYPE: ${INFINITO_TEST_DEPLOY_TYPE}" >&2 + echo "Invalid INFINITO_DEPLOY_TYPE: ${INFINITO_DEPLOY_TYPE}" >&2 echo "Allowed: server | workstation | universal" >&2 exit 2 ;; esac echo "Resolved inputs:" -echo " INFINITO_TEST_DEPLOY_TYPE=${INFINITO_TEST_DEPLOY_TYPE}" +echo " INFINITO_DEPLOY_TYPE=${INFINITO_DEPLOY_TYPE}" echo " INFINITO_DISTROS=${INFINITO_DISTROS}" echo " INFINITO_WHITELIST=${INFINITO_WHITELIST}" # Export outputs for workflow { - echo "test_deploy_type=${INFINITO_TEST_DEPLOY_TYPE}" + echo "test_deploy_type=${INFINITO_DEPLOY_TYPE}" echo "distros=${INFINITO_DISTROS}" echo "whitelist=${INFINITO_WHITELIST}" } >>"${GITHUB_OUTPUT}" # Export env for subsequent steps { - echo "INFINITO_TEST_DEPLOY_TYPE=${INFINITO_TEST_DEPLOY_TYPE}" + echo "INFINITO_DEPLOY_TYPE=${INFINITO_DEPLOY_TYPE}" echo "INFINITO_DISTROS=${INFINITO_DISTROS}" echo "INFINITO_WHITELIST=${INFINITO_WHITELIST}" } >>"${GITHUB_ENV}" diff --git a/scripts/tests/deploy/act/all.sh b/scripts/tests/deploy/act/all.sh index c0cf653362..2d630cbde1 100755 --- a/scripts/tests/deploy/act/all.sh +++ b/scripts/tests/deploy/act/all.sh @@ -3,26 +3,26 @@ set -euo pipefail # Run local deploy workflow via act for ALL apps (linear matrix) # Required: -# INFINITO_TEST_DEPLOY_TYPE server|workstation|universal +# INFINITO_DEPLOY_TYPE server|workstation|universal # INFINITO_DISTRO e.g. arch, debian, ubuntu -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE is not set (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE is not set (server|workstation|universal)}" : "${INFINITO_DISTRO:?INFINITO_DISTRO is not set (e.g. arch, debian, ubuntu)}" -case "${INFINITO_TEST_DEPLOY_TYPE}" in +case "${INFINITO_DEPLOY_TYPE}" in server | workstation | universal) ;; *) - echo "Invalid INFINITO_TEST_DEPLOY_TYPE: ${INFINITO_TEST_DEPLOY_TYPE}" >&2 + echo "Invalid INFINITO_DEPLOY_TYPE: ${INFINITO_DEPLOY_TYPE}" >&2 echo "Allowed: server | workstation | universal" >&2 exit 2 ;; esac -echo "=== act: deploy local (type=${INFINITO_TEST_DEPLOY_TYPE}, distros=${INFINITO_DISTRO}) ===" +echo "=== act: deploy local (type=${INFINITO_DEPLOY_TYPE}, distros=${INFINITO_DISTRO}) ===" act workflow_dispatch \ -W .github/workflows/test-deploy-local.yml \ - --input test_deploy_type="${INFINITO_TEST_DEPLOY_TYPE}" \ + --input test_deploy_type="${INFINITO_DEPLOY_TYPE}" \ --input distros="${INFINITO_DISTRO}" \ --input whitelist="" \ --container-options "--privileged" \ diff --git a/scripts/tests/deploy/act/app.sh b/scripts/tests/deploy/act/app.sh index af726cfdd4..b37d0db1a3 100755 --- a/scripts/tests/deploy/act/app.sh +++ b/scripts/tests/deploy/act/app.sh @@ -4,27 +4,27 @@ set -euo pipefail # Run local deploy workflow via act for a single app (linear matrix) # Required: # INFINITO_APPS e.g. web-app-nextcloud -# INFINITO_TEST_DEPLOY_TYPE server|workstation|universal +# INFINITO_DEPLOY_TYPE server|workstation|universal # INFINITO_DISTRO e.g. arch, debian, ubuntu : "${INFINITO_APPS:?INFINITO_APPS is not set (e.g. INFINITO_APPS=web-app-nextcloud)}" -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE is not set (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE is not set (server|workstation|universal)}" : "${INFINITO_DISTRO:?INFINITO_DISTRO is not set (e.g. arch, debian, ubuntu)}" -case "${INFINITO_TEST_DEPLOY_TYPE}" in +case "${INFINITO_DEPLOY_TYPE}" in server | workstation | universal) ;; *) - echo "Invalid INFINITO_TEST_DEPLOY_TYPE: ${INFINITO_TEST_DEPLOY_TYPE}" >&2 + echo "Invalid INFINITO_DEPLOY_TYPE: ${INFINITO_DEPLOY_TYPE}" >&2 echo "Allowed: server | workstation | universal" >&2 exit 2 ;; esac -echo "=== act: deploy local (type=${INFINITO_TEST_DEPLOY_TYPE}, app=${INFINITO_APPS}, distros=${INFINITO_DISTRO}) ===" +echo "=== act: deploy local (type=${INFINITO_DEPLOY_TYPE}, app=${INFINITO_APPS}, distros=${INFINITO_DISTRO}) ===" act workflow_dispatch \ -W .github/workflows/test-deploy-local.yml \ - --input test_deploy_type="${INFINITO_TEST_DEPLOY_TYPE}" \ + --input test_deploy_type="${INFINITO_DEPLOY_TYPE}" \ --input distros="${INFINITO_DISTRO}" \ --input whitelist="${INFINITO_APPS}" \ --container-options "--privileged" \ diff --git a/scripts/tests/deploy/ci/all.sh b/scripts/tests/deploy/ci/all.sh index 349f85f4ab..a980362f01 100755 --- a/scripts/tests/deploy/ci/all.sh +++ b/scripts/tests/deploy/ci/all.sh @@ -10,7 +10,7 @@ set -euo pipefail # # Required env: # INFINITO_APPS="web-app-keycloak" -# INFINITO_TEST_DEPLOY_TYPE="server|workstation|universal" +# INFINITO_DEPLOY_TYPE="server|workstation|universal" # INFINITO_DISTROS="arch debian ubuntu fedora centos" # INFINITO_INVENTORY_DIR="/path/to/inventory" # @@ -35,14 +35,14 @@ else fi : "${INFINITO_APPS:?INFINITO_APPS is required (e.g. INFINITO_APPS=web-app-keycloak)}" -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE is required (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE is required (server|workstation|universal)}" : "${INFINITO_DISTROS:?INFINITO_DISTROS is required (e.g. 'arch debian ubuntu fedora centos')}" : "${INFINITO_INVENTORY_DIR:?INFINITO_INVENTORY_DIR is required}" -case "${INFINITO_TEST_DEPLOY_TYPE}" in +case "${INFINITO_DEPLOY_TYPE}" in server | workstation | universal) ;; *) - echo "[ERROR] Invalid INFINITO_TEST_DEPLOY_TYPE: ${INFINITO_TEST_DEPLOY_TYPE}" >&2 + echo "[ERROR] Invalid INFINITO_DEPLOY_TYPE: ${INFINITO_DEPLOY_TYPE}" >&2 exit 2 ;; esac @@ -128,7 +128,7 @@ for distro in "${distro_arr[@]}"; do fi fi - echo "=== Running dedicated distro deploy: distro=${distro} app=${INFINITO_APPS} type=${INFINITO_TEST_DEPLOY_TYPE} ===" + echo "=== Running dedicated distro deploy: distro=${distro} app=${INFINITO_APPS} type=${INFINITO_DEPLOY_TYPE} ===" if [[ -n "${remaining}" ]]; then echo ">>> Time budget: remaining=${remaining}s max_seen=${max_seen}s" fi @@ -172,7 +172,7 @@ total="$((global_end - global_start))" echo echo "=== Summary ===" -echo "app=${INFINITO_APPS} type=${INFINITO_TEST_DEPLOY_TYPE}" +echo "app=${INFINITO_APPS} type=${INFINITO_DEPLOY_TYPE}" echo "ran=${ran} skipped=${skipped} failed=${failed}" echo "total_runtime=${total}s max_seen_duration=${max_seen}s" if [[ -n "${deadline}" ]]; then diff --git a/scripts/tests/deploy/local/deploy/README.md b/scripts/tests/deploy/local/deploy/README.md index 73e4875e2f..89dfbd8acb 100644 --- a/scripts/tests/deploy/local/deploy/README.md +++ b/scripts/tests/deploy/local/deploy/README.md @@ -27,8 +27,8 @@ The `bundles/` subtree mirrors the same axes for inventory bundles (`fresh.sh` | Entry point | What it does | Key inputs | Notes | |---|---|---|---| -| `apps/initialize/all.sh` | Discovers apps, creates `devices.yml`, and deploys all discovered apps. | `INFINITO_DISTRO`, `INFINITO_TEST_DEPLOY_TYPE`, `INFINITO_INVENTORY_DIR` | Fresh all-app inventory path. | +| `apps/initialize/all.sh` | Discovers apps, creates `devices.yml`, and deploys all discovered apps. | `INFINITO_DISTRO`, `INFINITO_DEPLOY_TYPE`, `INFINITO_INVENTORY_DIR` | Fresh all-app inventory path. | | `apps/initialize/selection.sh ` | Creates `devices.yml` for one or more apps and deploys them. | `INFINITO_APPS=` | Init and deploy path for a specific app set. | -| `apps/reinstall/selection.sh` | Recreates `devices.yml` and deploys one or more apps twice with `ASYNC_ENABLED=false` and `ASYNC_ENABLED=true`. | `INFINITO_DISTRO`, `INFINITO_INVENTORY_DIR`, `INFINITO_TEST_DEPLOY_TYPE`, `INFINITO_APPS` | Baseline and recovery path; purges entities first. | -| `apps/update/all.sh` | Deploys every app from an existing inventory. | `INFINITO_DISTRO`, `INFINITO_TEST_DEPLOY_TYPE`, `INFINITO_INVENTORY_DIR` | Requires `${INFINITO_INVENTORY_DIR}/devices.yml` and `.password`. | -| `apps/update/selection.sh` | Runs a targeted `infinito administration deploy dedicated` for one or more apps. | `INFINITO_APPS`, `INFINITO_TEST_DEPLOY_TYPE`, `INFINITO_CONTAINER`, `INFINITO_DEBUG`, `INFINITO_INVENTORY_DIR` | Reuses `devices.yml`. | +| `apps/reinstall/selection.sh` | Recreates `devices.yml` and deploys one or more apps twice with `ASYNC_ENABLED=false` and `ASYNC_ENABLED=true`. | `INFINITO_DISTRO`, `INFINITO_INVENTORY_DIR`, `INFINITO_DEPLOY_TYPE`, `INFINITO_APPS` | Baseline and recovery path; purges entities first. | +| `apps/update/all.sh` | Deploys every app from an existing inventory. | `INFINITO_DISTRO`, `INFINITO_DEPLOY_TYPE`, `INFINITO_INVENTORY_DIR` | Requires `${INFINITO_INVENTORY_DIR}/devices.yml` and `.password`. | +| `apps/update/selection.sh` | Runs a targeted `infinito administration deploy dedicated` for one or more apps. | `INFINITO_APPS`, `INFINITO_DEPLOY_TYPE`, `INFINITO_CONTAINER`, `INFINITO_DEBUG`, `INFINITO_INVENTORY_DIR` | Reuses `devices.yml`. | diff --git a/scripts/tests/deploy/local/deploy/apps/initialize/README.md b/scripts/tests/deploy/local/deploy/apps/initialize/README.md index 168aedfc88..a7b0570e17 100644 --- a/scripts/tests/deploy/local/deploy/apps/initialize/README.md +++ b/scripts/tests/deploy/local/deploy/apps/initialize/README.md @@ -7,7 +7,7 @@ Existing container state and shared entities are kept untouched. | Entry point | Scope | |---|---| -| `all.sh` | every discovered application (filtered by `INFINITO_TEST_DEPLOY_TYPE` and optional `INFINITO_WHITELIST`) | +| `all.sh` | every discovered application (filtered by `INFINITO_DEPLOY_TYPE` and optional `INFINITO_WHITELIST`) | | `selection.sh ` | one or more apps passed via `INFINITO_APPS` or as a positional argument | ## When to use 🎯 diff --git a/scripts/tests/deploy/local/deploy/apps/initialize/all.sh b/scripts/tests/deploy/local/deploy/apps/initialize/all.sh index 4c9bfd9585..581848be06 100755 --- a/scripts/tests/deploy/local/deploy/apps/initialize/all.sh +++ b/scripts/tests/deploy/local/deploy/apps/initialize/all.sh @@ -14,7 +14,7 @@ source "${SCRIPT_DIR}/../../../utils/cache-retry.sh" # Required environment # --------------------------------------------------------------------------- : "${INFINITO_DISTRO:?INFINITO_DISTRO must be set (arch|debian|ubuntu|fedora|centos)}" -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE must be set (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE must be set (server|workstation|universal)}" : "${INFINITO_INVENTORY_DIR:?INFINITO_INVENTORY_DIR must be set (e.g. /etc/inventories/local-full-server)}" : "${INFINITO_INVENTORY_FILE:?INFINITO_INVENTORY_FILE is not set — source scripts/meta/env/load.sh first}" : "${INFINITO_INVENTORY_VARS_FILE:?INFINITO_INVENTORY_VARS_FILE is not set — source scripts/meta/env/load.sh first}" @@ -27,7 +27,7 @@ RUNTIME_VARS_JSON='{"RUNTIME":"dev"}' echo "=== local full deploy (development compose stack) ===" echo "distro = ${INFINITO_DISTRO}" -echo "type = ${INFINITO_TEST_DEPLOY_TYPE}" +echo "type = ${INFINITO_DEPLOY_TYPE}" echo "limit = ${INFINITO_LIMIT_HOST}" echo "inventory_dir = ${INFINITO_INVENTORY_DIR}" echo "whitelist = ${INFINITO_WHITELIST}" @@ -43,7 +43,7 @@ echo ">>> Starting development compose stack (no build)" # --------------------------------------------------------------------------- # 2) Discover apps on HOST (needs docker compose) # --------------------------------------------------------------------------- -echo ">>> Discovering apps on host via scripts/meta/resolve/apps.sh (INFINITO_TEST_DEPLOY_TYPE=${INFINITO_TEST_DEPLOY_TYPE})" +echo ">>> Discovering apps on host via scripts/meta/resolve/apps.sh (INFINITO_DEPLOY_TYPE=${INFINITO_DEPLOY_TYPE})" # IMPORTANT: # - compose can emit warnings on STDOUT (depending on version/config) @@ -51,7 +51,7 @@ echo ">>> Discovering apps on host via scripts/meta/resolve/apps.sh (INFINITO_TE # - PYTHON from host venv must NOT be used inside container exec calls discover_out="$( set +e - INFINITO_TEST_DEPLOY_TYPE="${INFINITO_TEST_DEPLOY_TYPE}" \ + INFINITO_DEPLOY_TYPE="${INFINITO_DEPLOY_TYPE}" \ INFINITO_WHITELIST="${INFINITO_WHITELIST}" \ PYTHON=python3 \ scripts/meta/resolve/apps.sh 2> >(cat >&2) | @@ -63,7 +63,7 @@ discover_out="$( if [[ -z "${discover_out}" ]]; then echo "ERROR: apps discovery produced empty output" >&2 echo "DEBUG: raw apps.sh output (first 50 lines):" >&2 - INFINITO_TEST_DEPLOY_TYPE="${INFINITO_TEST_DEPLOY_TYPE}" INFINITO_WHITELIST="${INFINITO_WHITELIST}" PYTHON=python3 \ + INFINITO_DEPLOY_TYPE="${INFINITO_DEPLOY_TYPE}" INFINITO_WHITELIST="${INFINITO_WHITELIST}" PYTHON=python3 \ scripts/meta/resolve/apps.sh 2>&1 | sed -n '1,50p' >&2 exit 2 fi diff --git a/scripts/tests/deploy/local/deploy/apps/reinstall/README.md b/scripts/tests/deploy/local/deploy/apps/reinstall/README.md index dcfde9e3cc..87a977a826 100644 --- a/scripts/tests/deploy/local/deploy/apps/reinstall/README.md +++ b/scripts/tests/deploy/local/deploy/apps/reinstall/README.md @@ -14,6 +14,6 @@ Use this flow when stale container state or cross-application entities (for exam - Runs `development down` followed by `development up --when-down` to remove and re-create containers. - Purges shared entities relevant to the deploy (for example `matomo`). - Bakes a fresh inventory with `ASYNC_ENABLED=false` and `RUNTIME=dev`. -- Set `INFINITO_FULL_CYCLE=true` to run a second async pass after the initial sync pass. +- Set `full_cycle=true` (or `INFINITO_FULL_CYCLE=true` in the environment) to run a second async pass after the initial sync pass. For the non-destructive equivalent, see [initialize/](../initialize/README.md). diff --git a/scripts/tests/deploy/local/deploy/apps/reinstall/selection.sh b/scripts/tests/deploy/local/deploy/apps/reinstall/selection.sh index 0223b022fc..5e86b44feb 100755 --- a/scripts/tests/deploy/local/deploy/apps/reinstall/selection.sh +++ b/scripts/tests/deploy/local/deploy/apps/reinstall/selection.sh @@ -8,7 +8,7 @@ set -euo pipefail # Required env: # INFINITO_DISTRO arch|debian|ubuntu|fedora|centos # INFINITO_INVENTORY_DIR /etc/inventories/local-full-server -# INFINITO_TEST_DEPLOY_TYPE server|workstation|universal +# INFINITO_DEPLOY_TYPE server|workstation|universal # INFINITO_APPS web-app-* # # Optional: @@ -20,13 +20,13 @@ PYTHON="${PYTHON:-python3}" : "${INFINITO_DISTRO:?INFINITO_DISTRO must be set (e.g. arch)}" : "${INFINITO_INVENTORY_DIR:?INFINITO_INVENTORY_DIR must be set}" -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE must be set (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE must be set (server|workstation|universal)}" : "${INFINITO_APPS:?INFINITO_APPS must be set (e.g. web-app-keycloak)}" -case "${INFINITO_TEST_DEPLOY_TYPE}" in +case "${INFINITO_DEPLOY_TYPE}" in server | workstation | universal) ;; *) - echo "[ERROR] Invalid INFINITO_TEST_DEPLOY_TYPE: ${INFINITO_TEST_DEPLOY_TYPE}" >&2 + echo "[ERROR] Invalid INFINITO_DEPLOY_TYPE: ${INFINITO_DEPLOY_TYPE}" >&2 exit 2 ;; esac @@ -41,7 +41,7 @@ source "scripts/meta/env/load.sh" # shellcheck source=scripts/tests/deploy/local/utils/cache-retry.sh source "${SCRIPT_DIR}/../../../utils/cache-retry.sh" -echo "=== LOCAL: distro=${INFINITO_DISTRO} type=${INFINITO_TEST_DEPLOY_TYPE} app=${INFINITO_APPS} full_cycle=${INFINITO_FULL_CYCLE} ===" +echo "=== LOCAL: distro=${INFINITO_DISTRO} type=${INFINITO_DEPLOY_TYPE} app=${INFINITO_APPS} full_cycle=${INFINITO_FULL_CYCLE} ===" echo "limit_host=${INFINITO_LIMIT_HOST}" echo "inventory_dir=${INFINITO_INVENTORY_DIR}" echo diff --git a/scripts/tests/deploy/local/deploy/apps/update/all.sh b/scripts/tests/deploy/local/deploy/apps/update/all.sh index ad93c33112..1bd14ba5cd 100755 --- a/scripts/tests/deploy/local/deploy/apps/update/all.sh +++ b/scripts/tests/deploy/local/deploy/apps/update/all.sh @@ -5,7 +5,7 @@ set -euo pipefail # # Required: # INFINITO_DISTRO (arch|debian|ubuntu|fedora|centos) -# INFINITO_TEST_DEPLOY_TYPE (server|workstation|universal) +# INFINITO_DEPLOY_TYPE (server|workstation|universal) # INFINITO_INVENTORY_DIR (e.g. /etc/inventories/local-full-server) # # Optional: @@ -13,7 +13,7 @@ set -euo pipefail # INFINITO_DEBUG (default: false) # # Notes: -# - This does NOT create the inventory. Run make deploy-fresh-kept-apps INFINITO_APPS= first. +# - This does NOT create the inventory. Run make deploy apps= first. # - We recompute the app list to keep behavior deterministic with filters. SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -27,7 +27,7 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../../../../.." && pwd)" cd "${REPO_ROOT}" : "${INFINITO_DISTRO:?INFINITO_DISTRO must be set (arch|debian|ubuntu|fedora|centos)}" -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE must be set (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE must be set (server|workstation|universal)}" : "${INFINITO_INVENTORY_DIR:?INFINITO_INVENTORY_DIR must be set (e.g. /etc/inventories/local-full-server)}" INFINITO_DEBUG="$(normalize_bool_or_default "${INFINITO_DEBUG:-}" false INFINITO_DEBUG)" @@ -45,7 +45,7 @@ pw_file="${inv_dir}/.password" if [[ ! -f "${inv_file}" ]]; then echo "ERROR: inventory not found: ${inv_file}" >&2 - echo "Run: make deploy-fresh-kept-apps INFINITO_APPS=" >&2 + echo "Run: make deploy apps=" >&2 exit 2 fi @@ -56,7 +56,7 @@ fi echo "=== local run (ALL apps) ===" echo "distro = ${INFINITO_DISTRO}" -echo "type = ${INFINITO_TEST_DEPLOY_TYPE}" +echo "type = ${INFINITO_DEPLOY_TYPE}" echo "limit = ${INFINITO_LIMIT_HOST}" echo "debug = ${INFINITO_DEBUG}" echo "inventory_dir = ${inv_dir}" @@ -70,7 +70,7 @@ echo # Recompute apps list (optional, but keeps filters consistent) apps_json="$( - INFINITO_TEST_DEPLOY_TYPE="${INFINITO_TEST_DEPLOY_TYPE}" \ + INFINITO_DEPLOY_TYPE="${INFINITO_DEPLOY_TYPE}" \ INFINITO_WHITELIST="${INFINITO_WHITELIST:-}" \ scripts/meta/resolve/apps.sh )" diff --git a/scripts/tests/deploy/local/deploy/apps/update/selection.sh b/scripts/tests/deploy/local/deploy/apps/update/selection.sh index f07d1bf220..a4f6b68fbb 100755 --- a/scripts/tests/deploy/local/deploy/apps/update/selection.sh +++ b/scripts/tests/deploy/local/deploy/apps/update/selection.sh @@ -4,13 +4,13 @@ set -euo pipefail # Update a selection of apps inside the running infinito container (reuses inventory, no down/up). # Expects (ALL required): # INFINITO_APPS e.g. web-app-nextcloud -# INFINITO_TEST_DEPLOY_TYPE server|workstation|universal +# INFINITO_DEPLOY_TYPE server|workstation|universal # INFINITO_CONTAINER e.g. infinito_nexus_arch # INFINITO_DEBUG true|false # INFINITO_INVENTORY_DIR e.g. /etc/inventories/local-full-server : "${INFINITO_APPS:?INFINITO_APPS is not set (e.g. INFINITO_APPS=web-app-nextcloud)}" -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE is not set (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE is not set (server|workstation|universal)}" : "${INFINITO_CONTAINER:?INFINITO_CONTAINER is not set (e.g. infinito_nexus_arch)}" : "${INFINITO_DEBUG:?INFINITO_DEBUG is not set (true|false)}" : "${INFINITO_INVENTORY_DIR:?INFINITO_INVENTORY_DIR is not set (e.g. INFINITO_INVENTORY_DIR=/etc/inventories/local-full-server)}" @@ -27,10 +27,10 @@ if [[ -n "${INFINITO_VARIANT:-}" ]]; then INFINITO_INVENTORY_FILE="${INFINITO_INVENTORY_DIR}/devices.yml" fi -case "${INFINITO_TEST_DEPLOY_TYPE}" in +case "${INFINITO_DEPLOY_TYPE}" in server | workstation | universal) ;; *) - echo "Invalid INFINITO_TEST_DEPLOY_TYPE: ${INFINITO_TEST_DEPLOY_TYPE}" >&2 + echo "Invalid INFINITO_DEPLOY_TYPE: ${INFINITO_DEPLOY_TYPE}" >&2 echo "Allowed: server | workstation | universal" >&2 exit 2 ;; @@ -51,7 +51,7 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../../../../.." && pwd)" # shellcheck source=scripts/tests/deploy/local/utils/cache-retry.sh source "${SCRIPT_DIR}/../../../utils/cache-retry.sh" -echo "=== rapid deploy: type=${INFINITO_TEST_DEPLOY_TYPE} app=${INFINITO_APPS} container=${INFINITO_CONTAINER} debug=${INFINITO_DEBUG} ===" +echo "=== rapid deploy: type=${INFINITO_DEPLOY_TYPE} app=${INFINITO_APPS} container=${INFINITO_CONTAINER} debug=${INFINITO_DEBUG} ===" echo "inventory_dir=${INFINITO_INVENTORY_DIR}" deploy_with_cache_retry "reuse-${INFINITO_APPS//[^A-Za-z0-9._-]/-}" -- \ diff --git a/scripts/tests/deploy/local/deploy/bundles/fresh.sh b/scripts/tests/deploy/local/deploy/bundles/fresh.sh index aef1e60a66..d49dfc95b2 100755 --- a/scripts/tests/deploy/local/deploy/bundles/fresh.sh +++ b/scripts/tests/deploy/local/deploy/bundles/fresh.sh @@ -4,7 +4,7 @@ set -euo pipefail # One-off deploy of all apps cumulated from one or more inventory bundles. # # Usage: -# INFINITO_BUNDLES="education-suite,startup-essentials" make deploy-bundles +# INFINITO_BUNDLES="education-suite,startup-essentials" make deploy # # Behavior: # - Aggregates and deduplicates all role groups declared in each bundle's @@ -19,7 +19,7 @@ set -euo pipefail # INFINITO_FULL_CYCLE false (default) | true # INFINITO_DISTRO arch|debian|ubuntu|fedora|centos # INFINITO_INVENTORY_DIR /etc/inventories/local-full-server (typical) -# INFINITO_TEST_DEPLOY_TYPE server|workstation|universal +# INFINITO_DEPLOY_TYPE server|workstation|universal : "${INFINITO_BUNDLES:?INFINITO_BUNDLES must be set (e.g. INFINITO_BUNDLES=education-suite,startup-essentials)}" diff --git a/scripts/tests/deploy/local/deploy/bundles/update.sh b/scripts/tests/deploy/local/deploy/bundles/update.sh index e26cdad2bb..c3dc2800d3 100755 --- a/scripts/tests/deploy/local/deploy/bundles/update.sh +++ b/scripts/tests/deploy/local/deploy/bundles/update.sh @@ -4,15 +4,15 @@ set -euo pipefail # Update all apps cumulated from one or more inventory bundles (reuses inventory, no down/up, no purge). # # Usage: -# INFINITO_BUNDLES="education-suite,startup-essentials" make redeploy-bundles +# INFINITO_BUNDLES="education-suite,startup-essentials" make deploy mode=update # # Behavior: # - Aggregates and deduplicates all role groups declared in each bundle's # inventory.yml (see utils.inventory.bundle_apps). # - Exports INFINITO_APPS= and delegates to apps/update/selection.sh. # - Does NOT bring the stack down/up and does NOT purge entities. -# - Requires an already-initialized inventory (see deploy-bundles or -# deploy-fresh-kept-apps for the first run). +# - Requires an already-initialized inventory (see `make deploy` with +# INFINITO_BUNDLES set, or INFINITO_APPS, for the first run). # # Required env: # INFINITO_BUNDLES comma-separated bundle names @@ -20,7 +20,7 @@ set -euo pipefail # INFINITO_DEBUG true (default) | false # INFINITO_DISTRO arch|debian|ubuntu|fedora|centos # INFINITO_INVENTORY_DIR /etc/inventories/local-full-server (typical) -# INFINITO_TEST_DEPLOY_TYPE server|workstation|universal +# INFINITO_DEPLOY_TYPE server|workstation|universal # INFINITO_VARIANT matrix round index to pin redeploy to : "${INFINITO_BUNDLES:?INFINITO_BUNDLES must be set (e.g. INFINITO_BUNDLES=education-suite,startup-essentials)}" diff --git a/scripts/tests/deploy/local/deploy/main.sh b/scripts/tests/deploy/local/deploy/main.sh new file mode 100755 index 0000000000..3357b62e58 --- /dev/null +++ b/scripts/tests/deploy/local/deploy/main.sh @@ -0,0 +1,88 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Single entry point for every local deploy flow. +# +# Routing environment variables (set them via `make deploy =`; +# `make deploy` maps the short Make variables to the INFINITO_* env vars): +# INFINITO_DEPLOY_MODE initialize (default) | reinstall | update +# Short Make alias: mode +# INFINITO_BUNDLES optional. Comma-separated bundle names. When +# set, routes to bundles/fresh.sh (initialize +# or reinstall) or bundles/update.sh (update). +# INFINITO_APPS is ignored in this case (it +# gets resolved from the bundles). +# INFINITO_APPS optional. Comma-separated app ids. When set +# (and INFINITO_BUNDLES is not), routes to the +# selection.sh of the chosen verb. +# Short Make alias: apps +# INFINITO_PURGE_ENTITIES true | false (default: false). When true and +# INFINITO_APPS is set, runs the entity purge +# before the deploy. +# Short Make alias: purge +# INFINITO_DEPLOY_TYPE server | workstation | universal. Short +# Make alias: type. + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "${SCRIPT_DIR}/../../../../.." && pwd)" +cd "${REPO_ROOT}" + +MODE="${INFINITO_DEPLOY_MODE:-initialize}" # nocheck: deploy router knob; routes to apps// subscripts +PURGE="${INFINITO_PURGE_ENTITIES:-false}" # nocheck: deploy router knob; gates entity pre-purge + +case "${MODE}" in +initialize | reinstall | update) ;; +*) + echo "ERROR: invalid INFINITO_DEPLOY_MODE='${MODE}' (must be initialize|reinstall|update)" >&2 + exit 2 + ;; +esac + +run_pre_purge() { + if [[ "${PURGE}" == "true" ]]; then + echo ">>> Pre-purging entities for INFINITO_APPS=${INFINITO_APPS}" + bash scripts/tests/deploy/local/purge/entity.sh + fi +} + +if [[ -n "${INFINITO_BUNDLES:-}" ]]; then + case "${MODE}" in + initialize | reinstall) + target="${SCRIPT_DIR}/bundles/fresh.sh" + ;; + update) + target="${SCRIPT_DIR}/bundles/update.sh" + ;; + esac +elif [[ -n "${INFINITO_APPS:-}" ]]; then + case "${MODE}" in + initialize) + run_pre_purge + exec bash "${SCRIPT_DIR}/apps/initialize/selection.sh" "${INFINITO_APPS}" + ;; + reinstall) + run_pre_purge + target="${SCRIPT_DIR}/apps/reinstall/selection.sh" + ;; + update) + run_pre_purge + target="${SCRIPT_DIR}/apps/update/selection.sh" + ;; + esac +else + case "${MODE}" in + initialize) + echo "=== local full deploy (type=${INFINITO_DEPLOY_TYPE}, distro=${INFINITO_DISTRO}) ===" + target="${SCRIPT_DIR}/apps/initialize/all.sh" + ;; + reinstall) + echo "ERROR: INFINITO_DEPLOY_MODE=reinstall requires INFINITO_APPS or INFINITO_BUNDLES" >&2 + exit 2 + ;; + update) + target="${SCRIPT_DIR}/apps/update/all.sh" + ;; + esac +fi + +exec bash "${target}" diff --git a/scripts/tests/deploy/local/reset/README.md b/scripts/tests/deploy/local/reset/README.md index 9175aa65b7..47c4a639bc 100644 --- a/scripts/tests/deploy/local/reset/README.md +++ b/scripts/tests/deploy/local/reset/README.md @@ -8,7 +8,7 @@ For the canonical Make target index that invokes these helpers, see [make.md](.. | Entry point | What it does | Key inputs | Notes | |---|---|---|---| -| `inventory.sh` | Recreates `devices.yml` for all discovered apps without deploying them. | `INFINITO_DISTRO`, `INFINITO_TEST_DEPLOY_TYPE`, `INFINITO_INVENTORY_DIR` | Rebuilds the local inventory and keeps the runtime `.password` file. | +| `inventory.sh` | Recreates `devices.yml` for all discovered apps without deploying them. | `INFINITO_DISTRO`, `INFINITO_DEPLOY_TYPE`, `INFINITO_INVENTORY_DIR` | Rebuilds the local inventory and keeps the runtime `.password` file. | ## Script Map diff --git a/scripts/tests/deploy/local/reset/inventory.sh b/scripts/tests/deploy/local/reset/inventory.sh index 65145456fd..6177435e3b 100755 --- a/scripts/tests/deploy/local/reset/inventory.sh +++ b/scripts/tests/deploy/local/reset/inventory.sh @@ -5,11 +5,11 @@ set -euo pipefail # # Required: # INFINITO_DISTRO (arch|debian|ubuntu|fedora|centos) -# INFINITO_TEST_DEPLOY_TYPE (server|workstation|universal) +# INFINITO_DEPLOY_TYPE (server|workstation|universal) # INFINITO_INVENTORY_DIR (e.g. /etc/inventories/local-full-server) : "${INFINITO_DISTRO:?INFINITO_DISTRO must be set (arch|debian|ubuntu|fedora|centos)}" -: "${INFINITO_TEST_DEPLOY_TYPE:?INFINITO_TEST_DEPLOY_TYPE must be set (server|workstation|universal)}" +: "${INFINITO_DEPLOY_TYPE:?INFINITO_DEPLOY_TYPE must be set (server|workstation|universal)}" : "${INFINITO_INVENTORY_DIR:?INFINITO_INVENTORY_DIR must be set (e.g. /etc/inventories/local-full-server)}" : "${INFINITO_INVENTORY_FILE:?INFINITO_INVENTORY_FILE is not set — source scripts/meta/env/load.sh first}" : "${INFINITO_INVENTORY_VARS_FILE:?INFINITO_INVENTORY_VARS_FILE is not set — source scripts/meta/env/load.sh first}" @@ -19,7 +19,7 @@ RUNTIME_VARS_JSON='{"RUNTIME":"dev","SYS_SERVICE_RUNNER_RETRIES":1}' echo "=== local inventory init (ALL apps) ===" echo "distro = ${INFINITO_DISTRO}" -echo "type = ${INFINITO_TEST_DEPLOY_TYPE}" +echo "type = ${INFINITO_DEPLOY_TYPE}" echo "inventory_dir = ${INFINITO_INVENTORY_DIR}" echo @@ -30,7 +30,7 @@ echo ">>> Starting development compose stack (no build)" # 2) Discover apps on HOST (same as local/deploy/fresh-kept-all.sh) apps_json="$( - INFINITO_TEST_DEPLOY_TYPE="${INFINITO_TEST_DEPLOY_TYPE}" \ + INFINITO_DEPLOY_TYPE="${INFINITO_DEPLOY_TYPE}" \ INFINITO_WHITELIST="${INFINITO_WHITELIST:-}" \ PYTHON=python3 \ scripts/meta/resolve/apps.sh diff --git a/scripts/tests/deploy/local/utils/fresh-kept-all-init-and-deploy.sh b/scripts/tests/deploy/local/utils/fresh-kept-all-init-and-deploy.sh index a617545d6d..5a49715c1f 100755 --- a/scripts/tests/deploy/local/utils/fresh-kept-all-init-and-deploy.sh +++ b/scripts/tests/deploy/local/utils/fresh-kept-all-init-and-deploy.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -# In-container helper for `make deploy-fresh-kept-all`. +# In-container helper for `make deploy` (initialize all discovered apps). # # Called from the host wrapper at -# scripts/tests/deploy/local/deploy/fresh-kept-all.sh via +# scripts/tests/deploy/local/deploy/apps/initialize/all.sh via # `cli.administration.deploy.development exec --env KEY=VAL`, which injects the env-vars # asserted below. Performs entry bootstrap, creates the inventory and # runs the dedicated deploy in one in-container session. The repo is diff --git a/scripts/tests/deploy/local/utils/reuse-kept-all-deploy.sh b/scripts/tests/deploy/local/utils/reuse-kept-all-deploy.sh index f61aaa5201..1b2c344c54 100755 --- a/scripts/tests/deploy/local/utils/reuse-kept-all-deploy.sh +++ b/scripts/tests/deploy/local/utils/reuse-kept-all-deploy.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -# In-container helper for `make deploy-reuse-kept-all`. +# In-container helper for `make deploy mode=update`. # # Called from the host wrapper at -# scripts/tests/deploy/local/deploy/reuse-kept-all.sh via +# scripts/tests/deploy/local/deploy/apps/update/all.sh via # `cli.administration.deploy.development exec --env KEY=VAL`, which injects the env-vars # asserted below. The repo is mounted at ${INFINITO_SRC_DIR} by the dev # compose stack. diff --git a/scripts/tests/deploy/local/utils/reuse-kept-app-deploy.sh b/scripts/tests/deploy/local/utils/reuse-kept-app-deploy.sh index d7fe4e890a..9ca9813637 100755 --- a/scripts/tests/deploy/local/utils/reuse-kept-app-deploy.sh +++ b/scripts/tests/deploy/local/utils/reuse-kept-app-deploy.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash -# In-container helper for `make deploy-reuse-kept-apps`. +# In-container helper for `make deploy mode=update apps=…`. # # Called from the host wrapper at -# scripts/tests/deploy/local/deploy/reuse-kept-app.sh via `docker exec`, +# scripts/tests/deploy/local/deploy/apps/update/selection.sh via `docker exec`, # which is responsible for injecting the env-vars asserted below. The # repo is mounted at ${INFINITO_SRC_DIR} by the dev compose stack. # diff --git a/scripts/tests/environment/07_deploy_minimal.sh b/scripts/tests/environment/07_deploy_minimal.sh index 06f0ae2516..6564fd24e3 100755 --- a/scripts/tests/environment/07_deploy_minimal.sh +++ b/scripts/tests/environment/07_deploy_minimal.sh @@ -12,7 +12,7 @@ echo "Snapshotting cache counters before the deploy." CACHE_BEFORE="$(cache_snapshot)" echo "Deploying dashboard with matomo disabled to verify INFINITO_SERVICES_DISABLED suppresses the shared service in the inventory." -make deploy-fresh-purged-apps INFINITO_APPS="${DASHBOARD_APP}" INFINITO_SERVICES_DISABLED="matomo" +make deploy mode=reinstall apps="${DASHBOARD_APP}" INFINITO_SERVICES_DISABLED="matomo" inspect echo "Actively probing both caches to confirm pull-through works end-to-end." diff --git a/scripts/tests/environment/08_deploy_performance.sh b/scripts/tests/environment/08_deploy_performance.sh index c827baf548..d743dd304e 100755 --- a/scripts/tests/environment/08_deploy_performance.sh +++ b/scripts/tests/environment/08_deploy_performance.sh @@ -7,7 +7,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPT_DIR}/utils/common.sh" echo "Deploying matomo (full cycle: deploy + update pass) so it becomes reachable via its dedicated inventory entry." -make deploy-fresh-purged-apps INFINITO_APPS="${MATOMO_APP}" INFINITO_FULL_CYCLE=true +make deploy mode=reinstall apps="${MATOMO_APP}" INFINITO_FULL_CYCLE=true inspect echo "Re-trusting the CA after the fresh deploy rebuilt the certificates." diff --git a/scripts/tests/environment/09_deploy_reuse.sh b/scripts/tests/environment/09_deploy_reuse.sh index 33f3208255..ac2e063697 100755 --- a/scripts/tests/environment/09_deploy_reuse.sh +++ b/scripts/tests/environment/09_deploy_reuse.sh @@ -7,5 +7,5 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" source "${SCRIPT_DIR}/utils/common.sh" echo "Redeploying matomo (variant 1) while keeping inventory and packages to validate state reuse." -make deploy-reuse-kept-apps INFINITO_APPS="${MATOMO_APP}" INFINITO_VARIANT=1 +make deploy mode=update apps="${MATOMO_APP}" INFINITO_VARIANT=1 inspect diff --git a/tasks/stages/02_server.yml b/tasks/stages/02_server.yml index 3504ed295a..7c699baca9 100644 --- a/tasks/stages/02_server.yml +++ b/tasks/stages/02_server.yml @@ -27,7 +27,7 @@ - name: Run E2E Playwright tests include_role: name: "test-e2e-playwright" - # E2E fires in every controlled runtime: local dev (`make deploy-*` + # E2E fires in every controlled runtime: local dev (`make deploy` # bakes RUNTIME=dev into the inventory) and CI (act/github detected # via `cli.meta.runtime.detect_runtime`). Bare `RUNTIME=host` stays # opt-out: the user can suppress E2E even on a dev box by passing diff --git a/tests/integration/meta/env/test_dotenv_generator.py b/tests/integration/meta/env/test_dotenv_generator.py index fa3d57814d..55aba39dc1 100644 --- a/tests/integration/meta/env/test_dotenv_generator.py +++ b/tests/integration/meta/env/test_dotenv_generator.py @@ -57,7 +57,7 @@ EXPECTED_BASELINE_KEYS = frozenset( "INFINITO_DOCKER_VOLUME", "INFINITO_DOCKER_MOUNT", "INFINITO_OUTER_NETWORK_MTU", - "INFINITO_TEST_DEPLOY_TYPE", + "INFINITO_DEPLOY_TYPE", "INFINITO_TEST_PATTERN", "INFINITO_TEST_RUNNER", "INFINITO_LINT_RUNNER", diff --git a/utils/env/handlers/passthrough.py b/utils/env/handlers/passthrough.py index dbb6d78454..3279f9d502 100644 --- a/utils/env/handlers/passthrough.py +++ b/utils/env/handlers/passthrough.py @@ -37,7 +37,7 @@ STATIC_KEYS = ( "INFINITO_IP6", "INFINITO_PARENT_IMAGE", "INFINITO_PLAYWRIGHT_KEEP", - "INFINITO_TEST_DEPLOY_TYPE", + "INFINITO_DEPLOY_TYPE", "INFINITO_TEST_PATTERN", "INFINITO_TEST_RUNNER", "INFINITO_LINT_RUNNER",