diff --git a/.github/workflows/cancel-pull-request-runs.yml b/.github/workflows/cancel-pull-request-runs.yml index a1afd3858f..22d5b17639 100644 --- a/.github/workflows/cancel-pull-request-runs.yml +++ b/.github/workflows/cancel-pull-request-runs.yml @@ -26,4 +26,4 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPOSITORY: ${{ github.repository }} CURRENT_RUN_ID: ${{ github.run_id }} - run: bash scripts/administration/actions/cancel_pull_request_runs.sh + run: bash scripts/github/cancel_pull_request_runs.sh diff --git a/.github/workflows/delete-branch.yml b/.github/workflows/delete-branch.yml index e192038dbd..20c9f53ced 100644 --- a/.github/workflows/delete-branch.yml +++ b/.github/workflows/delete-branch.yml @@ -21,4 +21,4 @@ jobs: BRANCH: ${{ github.event.ref }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} REPOSITORY: ${{ github.repository }} - run: bash scripts/administration/actions/cancel_deleted_branch_runs.sh + run: bash scripts/github/cancel_deleted_branch_runs.sh diff --git a/Makefile b/Makefile index e0fcd849b2..faa77881a0 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ endif list tree mig dockerignore \ print-python \ dns-setup dns-remove \ - dev-environment-bootstrap dev-environment-teardown \ + environment-bootstrap environment-teardown \ wsl2-systemd-check wsl2-dns-setup wsl2-trust-windows \ apparmor-teardown apparmor-restore \ disable-ipv6 restore-ipv6 \ @@ -37,36 +37,36 @@ endif bootstrap setup-development # Bootstrap the local development environment. -dev-environment-bootstrap: wsl2-systemd-check install-lint apparmor-teardown dns-setup disable-ipv6 +environment-bootstrap: wsl2-systemd-check install-lint apparmor-teardown dns-setup disable-ipv6 # Tear down the local development environment. -dev-environment-teardown: apparmor-restore dns-remove restore-ipv6 +environment-teardown: apparmor-restore dns-remove restore-ipv6 # Enable systemd on WSL2. wsl2-systemd-check: - @bash scripts/administration/systemd/enable/wsl2.sh + @bash scripts/system/systemd/enable/wsl2.sh # Set up DNS on WSL2. wsl2-dns-setup: - @sudo bash scripts/administration/network/dns/setup/wsl.sh + @sudo bash scripts/system/network/dns/setup/wsl.sh # Trust Windows certificates in WSL2. wsl2-trust-windows: - @bash scripts/administration/tls/trust/wsl2.sh + @bash scripts/system/tls/trust/wsl2.sh # Configure DNS on Linux. dns-setup: wsl2-dns-setup - @bash scripts/administration/network/dns/setup/linux.sh + @bash scripts/system/network/dns/setup/linux.sh # Remove the DNS configuration. dns-remove: - @bash scripts/administration/network/dns/remove.sh + @bash scripts/system/network/dns/remove.sh # Tear down AppArmor for local development. apparmor-teardown: @echo "==> AppArmor: full teardown (local dev)" @if grep -q '^[Yy1]' /sys/module/apparmor/parameters/enabled 2>/dev/null; then \ - sudo bash scripts/administration/apparmor/teardown.sh; \ + sudo bash scripts/system/apparmor/teardown.sh; \ else \ echo "[apparmor] AppArmor module is not loaded โ€” skipping teardown"; \ fi @@ -75,23 +75,23 @@ apparmor-teardown: apparmor-restore: @echo "==> AppArmor: restore profiles" @if grep -q '^[Yy1]' /sys/module/apparmor/parameters/enabled 2>/dev/null; then \ - sudo bash scripts/administration/apparmor/restore.sh; \ + sudo bash scripts/system/apparmor/restore.sh; \ else \ echo "[apparmor] AppArmor module is not loaded โ€” skipping restore"; \ fi # Trust the local CA on Linux and WSL2. trust-ca: - @bash scripts/administration/tls/trust/linux.sh - @bash scripts/administration/tls/trust/wsl2.sh + @bash scripts/system/tls/trust/linux.sh + @bash scripts/system/tls/trust/wsl2.sh # Disable IPv6 for local development. disable-ipv6: - @sudo bash scripts/administration/network/ipv6/disable.sh + @sudo bash scripts/system/network/ipv6/disable.sh # Restore IPv6 settings. restore-ipv6: - @sudo bash scripts/administration/network/ipv6/restore.sh + @sudo bash scripts/system/network/ipv6/restore.sh # Remove ignored files from the working tree. clean: @@ -110,11 +110,11 @@ clean-sudo: # Run the broad low-hardware cleanup routine. purge-system: - @bash scripts/purge/system.sh + @bash scripts/system/purge/system.sh # Run the broadest cleanup bundle. purge-all: - @bash scripts/purge/all.sh + @bash scripts/system/purge/all.sh # Restart the development stack. restart: diff --git a/docs/contributing/environment/hardware.md b/docs/contributing/environment/hardware.md index 92d26c055d..0293ff15dd 100644 --- a/docs/contributing/environment/hardware.md +++ b/docs/contributing/environment/hardware.md @@ -111,7 +111,7 @@ That makes it easier to see whether the real issue is Docker, journald, a packag ## Cleanup -The cleanup SPOT is [scripts/purge/README.md](../../../scripts/purge/README.md). Use that page for the canonical entry points. +The cleanup SPOT is [scripts/system/purge/README.md](../../../scripts/system/purge/README.md). Use that page for the canonical entry points. For the one-time Windows `cleanmgr /sageset:1` setup, set `PURGE_WINDOWS_CLEANMGR_SETUP=true` before you run `make purge-system`. diff --git a/docs/contributing/environment/setup.md b/docs/contributing/environment/setup.md index 99d9cf55c5..a3229030be 100644 --- a/docs/contributing/environment/setup.md +++ b/docs/contributing/environment/setup.md @@ -27,7 +27,7 @@ Run these commands from the repository root: ```bash make bootstrap -make dev-environment-bootstrap +make environment-bootstrap make up make trust-ca ``` @@ -37,7 +37,7 @@ make trust-ca | Phase | Command | What it does | |---|---|---| | Initial setup | `make bootstrap` | Installs project dependencies and runs the first repository setup. | -| Host preparation | `make dev-environment-bootstrap` | Prepares the local development machine for the project workflow. | +| Host preparation | `make environment-bootstrap` | Prepares the local development machine for the project workflow. | | Start stack | `make up` | Starts the local development stack. | | Browser trust | `make trust-ca` | Trusts the generated local [CA](https://en.wikipedia.org/wiki/Certificate_authority) so `*.infinito.example` works correctly in your browser. | @@ -47,7 +47,7 @@ When you are done, use these commands to stop the stack and clean up the local e ```bash make down -make dev-environment-teardown +make environment-teardown ``` #### Teardown Commands @@ -55,7 +55,7 @@ make dev-environment-teardown | Phase | Command | What it does | |---|---|---| | Stop stack | `make down` | Stops the local development stack. | -| Host cleanup | `make dev-environment-teardown` | Reverts local development environment changes where supported. | +| Host cleanup | `make environment-teardown` | Reverts local development environment changes where supported. | ### Full Development Flow @@ -66,13 +66,13 @@ The repository already contains a development helper script at [development.sh]( | Step | Command | Purpose in this flow | |---|---|---| | 1 | `make install` | Installs the dependencies needed before running the local development flow. | -| 2 | `make dev-environment-bootstrap` | Prepares the host machine for local development. | +| 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 | `APP=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). | | 6 | `make trust-ca` | Makes the generated local certificates trusted by the host browser. | | 7 | `make down` | Stops the running development stack. | -| 8 | `make dev-environment-teardown` | Cleans up host-side development environment changes. | +| 8 | `make environment-teardown` | Cleans up host-side development environment changes. | Use this as a practical reference when you want to understand how local development is expected to work. diff --git a/docs/contributing/tools/README.md b/docs/contributing/tools/README.md index 3b1c6288ad..c7d6652105 100644 --- a/docs/contributing/tools/README.md +++ b/docs/contributing/tools/README.md @@ -8,8 +8,9 @@ Use these pages together when you work on the local runtime or on agent-specific ## Start Here +- [Makefile Commands](makefile.md) - [Act Workflow Checks](act.md) - [Docker and Runtime Commands](docker.md) - [Agent Guidelines](agents.md) -If you are unsure where to begin, start with the Docker guide for runtime tasks or the agent guide for agent-specific workflow guidance. +If you are unsure where to begin, start with the Makefile guide for command discovery, the Docker guide for runtime context, or the agent guide for agent-specific workflow guidance. diff --git a/docs/contributing/tools/docker.md b/docs/contributing/tools/docker.md index 2c8cb8c76a..9948711358 100644 --- a/docs/contributing/tools/docker.md +++ b/docs/contributing/tools/docker.md @@ -2,51 +2,16 @@ # Docker and Runtime Commands -Use these commands from the repository root. They are thin `make` wrappers around the Docker build scripts and the local compose stack helpers. +Use this page for the Docker/runtime context around the project. +The canonical `make` command index now lives in [Makefile Commands](makefile.md). -## Image Builds +## Scope -| Category | Command | What it does | When to use it | -|---|---|---|---| -| Build | `make build` | Builds the local image for the active `INFINITO_DISTRO`. | Use this after Dockerfile changes or whenever you want a fresh local image. | -| Build if missing | `make build-missing` | Builds the image only when it is not already present locally. | Use this for a quick local check when you do not want to rebuild unnecessarily. | -| No-cache build | `make build-no-cache` | Rebuilds the image without Docker cache. | Use this when cache reuse might hide a change or when you are debugging the build. | -| No-cache all distros | `make build-no-cache-all` | Rebuilds the no-cache image for every distro in `DISTROS`. | Use this for release-level validation or when you need to verify all distro variants. | -| Build dependency image | `make build-dependency` | Pulls the `pkgmgr` base image used by the build. | Use this when you want to refresh the base image or debug build inputs. | -| Cleanup CI images | `make build-cleanup` | Removes Docker images created for CI-style build workflows. | Use this when local disk usage grows or old CI images accumulate. | - -## Cleanup - -| Category | Command | What it does | When to use it | -|---|---|---|---| -| System purge | `make purge-system` | Runs `scripts/purge/system.sh` to clear repository, Docker, journald, package, and language caches. | Use this when disk usage is tight or you want the broad low-hardware cleanup pass. | -| Full purge | `make purge-all` | Runs `scripts/purge/all.sh`, which chains `make purge-system`, `make build-cleanup`, and `make container-purge-system`. | Use this when you want the broadest local cleanup bundle. | -| Full purge script | `bash scripts/purge/all.sh` | Runs the broader cleanup bundle directly. | Use this when you want the same behavior without going through `make`. | - -## Compose Stack - -| Category | Command | What it does | When to use it | -|---|---|---|---| -| Start stack | `make up` | Starts the local compose stack and builds the image if it is missing. | Use this to bring the development stack online. | -| Stop stack | `make down` | Stops the compose stack and removes volumes. | Use this when you want a clean shutdown and disposable local state. | -| Pause services | `make stop` | Stops running services without removing volumes. | Use this when you want a fast stop and plan to start the same state again. | -| Restart stack | `make restart` | Stops the stack and starts it again. | Use this after configuration changes or when the stack needs a full restart. | - -## Container Inspection - -| Category | Command | What it does | When to use it | -|---|---|---|---| -| Inspect container | `make exec` | Delegates to `scripts/tests/deploy/local/exec/container.sh`, which opens an interactive shell in the running infinito container with `docker exec -it ... sh`. | Use this when you need to inspect live state or run a quick command inside the container. | - -## Support Targets - -| Category | Command | What it does | When to use it | -|---|---|---|---| -| Docker ignore file | `make dockerignore` | Regenerates `.dockerignore` from `.gitignore`. | Use this only when you need to recreate the generated Docker ignore file. | +- Use [Makefile Commands](makefile.md) when you want the concrete repository targets. +- Use [Development](../development/README.md) for app-level local deploy flows and end-to-end checks. +- Use [Testing and Validation](../development/testing.md) for lint, unit, integration, and Playwright guidance. ## Notes -- The commands use the current `INFINITO_DISTRO` setting from the environment. -- `make down` is destructive because it removes volumes; use `make stop` if you want to preserve state. -- `make up` may build missing images automatically, so you often do not need a separate build step for a first start. -- For app-level local deploy flows and end-to-end checks, see [Development](../development/README.md). +- The local runtime is driven from the repository root through Make targets. +- Keep Docker-specific explanations here and keep the command reference in `makefile.md`. diff --git a/docs/contributing/tools/makefile.md b/docs/contributing/tools/makefile.md new file mode 100644 index 0000000000..b9e8628025 --- /dev/null +++ b/docs/contributing/tools/makefile.md @@ -0,0 +1,126 @@ +[Back to CONTRIBUTING hub](../../../CONTRIBUTING.md) + +# Makefile Commands + +Use these commands from the repository root. This is the SPOT for `make` targets in Infinito Nexus. +Use the dedicated script READMEs for the underlying shell helpers, and use the development/testing guides for deeper workflow details. + +## Image Builds + +| Category | Command | What it does | When to use it | +|---|---|---|---| +| Build | `make build` | Builds the local image for the active `INFINITO_DISTRO`. | Use this after Dockerfile changes or whenever you want a fresh local image. | +| Build if missing | `make build-missing` | Builds the image only when it is not already present locally. | Use this for a quick local check when you do not want to rebuild unnecessarily. | +| No-cache build | `make build-no-cache` | Rebuilds the image without Docker cache. | Use this when cache reuse might hide a change or when you are debugging the build. | +| No-cache all distros | `make build-no-cache-all` | Rebuilds the no-cache image for every distro in `DISTROS`. | Use this for release-level validation or when you need to verify all distro variants. | +| Build dependency image | `make build-dependency` | Pulls the `pkgmgr` base image used by the build. | Use this when you want to refresh the base image or debug build inputs. | +| Cleanup CI images | `make build-cleanup` | Removes Docker images created for CI-style build workflows. | Use this when local disk usage grows or old CI images accumulate. | +| Regenerate Docker ignore | `make dockerignore` | Regenerates `.dockerignore` from `.gitignore`. | Use this when the Docker ignore file needs to be refreshed. | + +## Install + +| Category | Command | What it does | When to use it | +|---|---|---|---| +| System Python prerequisites | `make install-system-python` | Installs the system Python prerequisites. | Use this when the host is missing the Python base packages. | +| Virtual environment | `make install-venv` | Creates the virtual environment. | Use this when you need the repository Python environment. | +| Python tooling | `make install-python` | Installs the Python tooling. | Use this when you need the Python toolchain after creating the virtual environment. | +| Ansible dependencies | `make install-ansible` | Installs the Ansible dependencies. | Use this when you changed Ansible-related code or need the Ansible collections. | +| Lint dependencies | `make install-lint` | Installs lint-related tooling. | Use this when you only need the lint stack. | +| Full install | `make install` | Installs the repository tooling needed for development and tests. | Use this on a fresh machine or before validation. | + +## Environment Setup + +| Category | Command | What it does | When to use it | +|---|---|---|---| +| Environment bootstrap | `make environment-bootstrap` | Runs the local bootstrap sequence for WSL2, lint tooling, AppArmor, DNS, and IPv6. | Use this when you want to prepare a fresh development host. | +| Environment teardown | `make environment-teardown` | Reverses the local bootstrap sequence. | Use this when you want to restore host settings. | +| Enable WSL2 systemd | `make wsl2-systemd-check` | Ensures WSL2 systemd support is configured. | Use this before WSL2-specific setup that depends on systemd. | +| Set up DNS on WSL2 | `make wsl2-dns-setup` | Configures DNS for WSL2. | Use this when you are working in WSL2 and need local DNS routing. | +| Configure DNS | `make dns-setup` | Configures DNS on the current host. | Use this for Linux host DNS setup. | +| Remove DNS | `make dns-remove` | Removes the DNS configuration. | Use this to clean up the DNS setup. | +| Trust CA on Windows | `make wsl2-trust-windows` | Imports the local CA and updates hosts entries from WSL2. | Use this when you need Windows trust-store updates from WSL2. | +| Trust local CA | `make trust-ca` | Trusts the local CA on Linux and WSL2. | Use this after the CA or host entries change. | +| Disable IPv6 | `make disable-ipv6` | Disables IPv6 for local development. | Use this when a workflow needs IPv6 off. | +| Restore IPv6 | `make restore-ipv6` | Restores the previous IPv6 settings. | Use this after a temporary IPv6 change. | + +## Repository Setup and Discovery + +| Category | Command | What it does | When to use it | +|---|---|---|---| +| Setup | `make setup` | Runs the repository setup step after generating `.dockerignore`. | Use this when you want the baseline project setup without installing the full dev stack. | +| Setup development | `make setup-development` | Creates the development setup marker. | Use this when you want to prepare a development-specific setup state. | +| Bootstrap | `make bootstrap` | Installs dependencies and prepares the project. | Use this on a fresh machine or a new checkout. | +| Setup clean | `make setup-clean` | Cleans ignored files and then runs setup. | Use this when you want a clean setup pass. | +| List roles | `make list` | Prints the repository role list. | Use this when you need the current role inventory. | +| Tree view | `make tree` | Prints the repository tree. | Use this when you want a compact structural overview. | +| Meta graph inputs | `make mig` | Builds the meta graph inputs from `list` and `tree`. | Use this when you are generating or refreshing meta graph data. | + +## Runtime Stack + +| Category | Command | What it does | When to use it | +|---|---|---|---| +| Start stack | `make up` | Starts the local compose stack and builds the image if it is missing. | Use this to bring the development stack online. | +| Stop stack | `make down` | Stops the compose stack and removes volumes. | Use this when you want a clean shutdown and disposable local state. | +| Pause services | `make stop` | Stops running services without removing volumes. | Use this when you want a fast stop and plan to start the same state again. | +| Restart stack | `make restart` | Stops the stack and starts it again. | Use this after configuration changes or when the stack needs a full restart. | +| Inspect container | `make exec` | Opens an interactive shell in the running infinito container. | Use this when you need to inspect live state or run a quick command inside the container. | + +## Validation + +### Lint + +| Category | Command | What it does | When to use it | +|---|---|---|---| +| Install lint tooling | `make install-lint` | Installs lint-related tooling. | Use this when you only need the lint stack. | +| Lint | `make lint` | Runs the main lint checks for the repository. | Use this when you want a broad lint pass before pushing. | +| Lint test suite | `make test-lint` | Runs the lint test suite inside the development environment. | Use this when you want CI-like lint validation. | +| Lint action | `make lint-action` | Runs the GitHub Actions lint checks. | Use this when you changed workflow files or workflow logic. | +| Lint Ansible | `make lint-ansible` | Runs the Ansible lint checks. | Use this when you changed Ansible roles, inventories, or playbook-related files. | +| Lint Python | `make lint-python` | Runs the Python lint checks. | Use this when you changed Python code. | +| Lint shell | `make lint-shellcheck` | Runs shellcheck lint checks. | Use this when you changed shell scripts. | + +### Test + +| Category | Command | What it does | When to use it | +|---|---|---|---| +| Install dependencies | `make install` | Installs the repository tooling needed for development and tests. | Use this before running validation on a fresh machine or environment. | +| Unit tests | `make test-unit` | Runs the unit test suite. | Use this when you changed Python logic or other isolated code paths. | +| Integration tests | `make test-integration` | Runs the integration test suite. | Use this when your change affects behavior across modules or runtime boundaries. | +| Combined validation | `make test` | Runs the main combined validation flow. | Use this whenever a change touches at least one file that is not `.md` or `.rst`, or before opening a Pull Request. | + +### Act + +| Category | Command | What it does | When to use it | +|---|---|---|---| +| Act workflow suite | `make act-all` | Runs the full local Act workflow suite. | Use this when you want to verify workflow behavior locally. | +| Act app workflow | `make act-app` | Runs the app-focused Act checks. | Use this when you are changing app-scoped workflow logic. | +| Act workflow file | `make act-workflow` | Runs one selected workflow with Act. | Use this when you want to focus on a single workflow file. | + +## Cleanup + +| Category | Command | What it does | When to use it | +|---|---|---|---| +| Remove ignored files | `make clean` | Removes ignored files from the working tree. | Use this when you want to clear generated files without sudo. | +| Remove ignored files with sudo | `make clean-sudo` | Removes ignored files from the working tree with elevated privileges. | Use this when file ownership prevents a normal clean. | +| System purge | `make purge-system` | Runs `scripts/system/purge/system.sh` to clear repository, Docker, journald, package, and language caches. | Use this when disk usage is tight or you want the broad low-hardware cleanup pass. | +| Full purge | `make purge-all` | Runs `scripts/system/purge/all.sh`, which chains `make container-purge-system`, `make build-cleanup`, and `make purge-system`. | Use this when you want the broadest local cleanup bundle. | +| Refresh inventory | `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. | +| Purge app entity | `make container-purge-entity` | Purges one or more app entities inside the running container. | Use this before rerunning a purged app deployment. | +| Purge container state | `make container-purge-system` | Removes inventory, web config, and lib state in the running container. | Use this when you want a destructive local container reset. | + +## Local Deploy + +| 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 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. | + +## Notes + +- The commands use the current `INFINITO_DISTRO` setting from the environment where relevant. +- For app-level local deploy flows and end-to-end checks, see [Development](../development/README.md). +- For validation strategy and Playwright guidance, see [Testing and Validation](../development/testing.md). diff --git a/scripts/README.md b/scripts/README.md index 9cb5c33870..a006e1be3e 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -2,6 +2,11 @@ This directory contains automation scripts used across the project. +- [system/](system/) contains host and system-facing helpers. +- [container/](container/) contains helpers that run inside the local container. +- [github/](github/) contains GitHub workflow helper scripts. +- For the canonical Make target index, see [docs/contributing/tools/makefile.md](../docs/contributing/tools/makefile.md). + - ๐Ÿ› ๏ธ Organize operational helpers for development, CI, release, and maintenance - ๐Ÿงญ Separate responsibilities into focused subdirectories with clear scope - ๐Ÿ“š Keep script-based workflows discoverable and easier to navigate diff --git a/scripts/administration/network/README.md b/scripts/administration/network/README.md deleted file mode 100644 index 0c79542997..0000000000 --- a/scripts/administration/network/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Network Administration ๐ŸŒ - -This directory groups low-level network adjustments that support local development and test orchestration. - -Networking changes are easy to underestimate: a tiny tweak can improve reproducibility for one workflow while creating surprising side effects for another. Because of that, the philosophy here is to keep changes scoped, understandable, and easy to roll back. ๐Ÿ” - -Work in this area should aim for: - -- minimal host impact -- clear before/after state -- graceful handling of missing kernel or service capabilities -- compatibility across different Linux environments used by contributors and CI - -The goal is simple: make development networking reliable without turning the host system into a science experiment. ๐Ÿงช diff --git a/scripts/administration/network/dns/README.md b/scripts/administration/network/dns/README.md deleted file mode 100644 index c0ca6c796c..0000000000 --- a/scripts/administration/network/dns/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# DNS Helpers ๐ŸŒ - -This directory contains the DNS-related helper layer used by Infinito.Nexus during local development and environment preparation. - -The material here is about shaping name resolution in a predictable way so that local domains, service discovery, and development-oriented routing behave consistently across different machines. Rather than representing application logic, it represents operational glue between the project and the host resolver setup. ๐Ÿ”ง - -Changes in this area should stay careful and conservative: - -- keep the intent obvious -- minimize impact on the host -- prefer reversible adjustments -- behave gracefully when platform capabilities differ - -In short, this directory exists to make local DNS behavior dependable without turning host networking into a fragile black box. ๐Ÿงญ - -For the non-`systemd` fallback, the host entries are generated from the role configs: - -- canonical domains and aliases come from `roles/*/config/main.yml` -- the CLI entrypoint lives in `cli/meta/domains/__main__.py` -- the reusable generator logic lives in `utils/domains/list.py` -- `DOMAIN_PRIMARY` is rendered before the list is emitted -- the DNS fallback calls the generator with `--alias --www` -- `INFINITO_DNS_HOSTS` can still override the generated list explicitly diff --git a/scripts/container/README.md b/scripts/container/README.md new file mode 100644 index 0000000000..69b831373e --- /dev/null +++ b/scripts/container/README.md @@ -0,0 +1,9 @@ +# Container Scripts + +This is the SPOT for container-side helpers under `scripts/container/`. +Use the README in each child directory as the canonical entry point for that area. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../docs/contributing/tools/makefile.md). + +## Areas + +- [purge/](purge/) for container-local cleanup helpers diff --git a/scripts/container/purge/README.md b/scripts/container/purge/README.md new file mode 100644 index 0000000000..38633383f3 --- /dev/null +++ b/scripts/container/purge/README.md @@ -0,0 +1,12 @@ +# Container Purge + +This is the SPOT for container-local cleanup helpers under `scripts/container/purge/`. +These scripts run inside the local infinito container and remove container-local state only. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../docs/contributing/tools/makefile.md). + +## Entry Points + +| Entry point | What it does | Notes | +|---|---|---| +| `web.sh` | Removes nginx and self-signed CA state inside the container. | Called by the local purge wrapper. | +| `entity/` | Purges app or stack data inside the container. | See the child directory README for the exact scripts. | diff --git a/scripts/container/purge/entity/README.md b/scripts/container/purge/entity/README.md new file mode 100644 index 0000000000..1722a2f366 --- /dev/null +++ b/scripts/container/purge/entity/README.md @@ -0,0 +1,14 @@ +# Entity Purge + +This is the SPOT for entity purge helpers under `scripts/container/purge/entity/`. +Use these scripts for stack-level cleanup inside the running container. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../docs/contributing/tools/makefile.md). + +## Entry Points + +| Script | What it does | Key inputs | +|---|---|---| +| `all.sh` | Orchestrates database, compose, and filesystem cleanup. | Stack names, `--wipe-data-only`, `--db-only` | +| `compose.sh` | Stops the compose stack and removes volumes. | Stack names | +| `db.sh` | Drops or truncates the backing database. | Stack names, `--wipe-data-only` | +| `dir.sh` | Removes the stack directory and its volumes. | Stack names | diff --git a/scripts/administration/purge/entity/all.sh b/scripts/container/purge/entity/all.sh similarity index 100% rename from scripts/administration/purge/entity/all.sh rename to scripts/container/purge/entity/all.sh diff --git a/scripts/administration/purge/entity/compose.sh b/scripts/container/purge/entity/compose.sh similarity index 100% rename from scripts/administration/purge/entity/compose.sh rename to scripts/container/purge/entity/compose.sh diff --git a/scripts/administration/purge/entity/db.sh b/scripts/container/purge/entity/db.sh similarity index 100% rename from scripts/administration/purge/entity/db.sh rename to scripts/container/purge/entity/db.sh diff --git a/scripts/administration/purge/entity/dir.sh b/scripts/container/purge/entity/dir.sh similarity index 100% rename from scripts/administration/purge/entity/dir.sh rename to scripts/container/purge/entity/dir.sh diff --git a/scripts/administration/purge/web.sh b/scripts/container/purge/web.sh similarity index 100% rename from scripts/administration/purge/web.sh rename to scripts/container/purge/web.sh diff --git a/scripts/github/README.md b/scripts/github/README.md new file mode 100644 index 0000000000..f003e2f077 --- /dev/null +++ b/scripts/github/README.md @@ -0,0 +1,12 @@ +# GitHub Workflow Helpers + +This is the SPOT for GitHub workflow helper scripts under `scripts/github/`. +These helpers are called from `.github/workflows/`. +For the repository Make target index, see [docs/contributing/tools/makefile.md](../../docs/contributing/tools/makefile.md). + +## Entry Points + +| Script | What it does | Used by | +|---|---|---| +| `cancel_deleted_branch_runs.sh` | Cancels active workflow runs for a deleted branch. | `.github/workflows/delete-branch.yml` | +| `cancel_pull_request_runs.sh` | Cancels active workflow runs for a closed pull request. | `.github/workflows/cancel-pull-request-runs.yml` | diff --git a/scripts/administration/actions/cancel_deleted_branch_runs.sh b/scripts/github/cancel_deleted_branch_runs.sh similarity index 100% rename from scripts/administration/actions/cancel_deleted_branch_runs.sh rename to scripts/github/cancel_deleted_branch_runs.sh diff --git a/scripts/administration/actions/cancel_pull_request_runs.sh b/scripts/github/cancel_pull_request_runs.sh similarity index 100% rename from scripts/administration/actions/cancel_pull_request_runs.sh rename to scripts/github/cancel_pull_request_runs.sh diff --git a/scripts/purge/README.md b/scripts/purge/README.md deleted file mode 100644 index f7665d7a0b..0000000000 --- a/scripts/purge/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# System Purge - -This is the SPOT for host and system cleanup helpers under `scripts/purge/`. - -## Entry Points - -| Entry point | What it does | Key inputs | Notes | -|---|---|---|---| -| `make purge-system` / `system.sh` | Runs the broad low-hardware cleanup pass from the repository root. | `PURGE_WINDOWS_CLEANMGR_SETUP` | Best-effort and safe to rerun. | -| `make purge-all` / `all.sh` | Runs `purge-system` plus the broader repository cleanup bundle. | `APP`, `INFINITO_CONTAINER`, `INVENTORY_DIR`, `PURGE_WINDOWS_CLEANMGR_SETUP` | Best-effort and safe to rerun; container cleanup needs the local stack. | - -## Script Map - -- [all.sh](all.sh) -- [system.sh](system.sh) diff --git a/scripts/system/README.md b/scripts/system/README.md new file mode 100644 index 0000000000..d4ca66463e --- /dev/null +++ b/scripts/system/README.md @@ -0,0 +1,13 @@ +# System Scripts + +This is the SPOT for system-facing helpers under `scripts/system/`. +Use the README in each child directory as the canonical entry point for that area. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../docs/contributing/tools/makefile.md). + +## Areas + +- [apparmor/](apparmor/) for AppArmor maintenance helpers +- [network/](network/) for DNS and IPv6 helpers +- [purge/](purge/) for host and repository cleanup helpers +- [systemd/](systemd/) for WSL2 systemd helpers +- [tls/](tls/) for CA trust helpers diff --git a/scripts/administration/apparmor/README.md b/scripts/system/apparmor/README.md similarity index 84% rename from scripts/administration/apparmor/README.md rename to scripts/system/apparmor/README.md index 0043303c8a..a05095940d 100644 --- a/scripts/administration/apparmor/README.md +++ b/scripts/system/apparmor/README.md @@ -12,3 +12,5 @@ When changing anything in this area, prefer behavior that is: - quiet on unsupported systems, but loud when real integrity risks appear In short: these files exist to help development move quickly without teaching the project to be careless around host security controls. โš™๏ธ + +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../docs/contributing/tools/makefile.md). diff --git a/scripts/administration/apparmor/common.sh b/scripts/system/apparmor/common.sh similarity index 100% rename from scripts/administration/apparmor/common.sh rename to scripts/system/apparmor/common.sh diff --git a/scripts/administration/apparmor/restore.sh b/scripts/system/apparmor/restore.sh similarity index 91% rename from scripts/administration/apparmor/restore.sh rename to scripts/system/apparmor/restore.sh index 989807a1fb..221ff68424 100755 --- a/scripts/administration/apparmor/restore.sh +++ b/scripts/system/apparmor/restore.sh @@ -2,7 +2,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=scripts/administration/apparmor/common.sh +# shellcheck source=scripts/system/apparmor/common.sh source "${SCRIPT_DIR}/common.sh" echo "[apparmor] restoring profiles" diff --git a/scripts/administration/apparmor/teardown.sh b/scripts/system/apparmor/teardown.sh similarity index 93% rename from scripts/administration/apparmor/teardown.sh rename to scripts/system/apparmor/teardown.sh index 852c4ae981..5c1babf452 100755 --- a/scripts/administration/apparmor/teardown.sh +++ b/scripts/system/apparmor/teardown.sh @@ -2,7 +2,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=scripts/administration/apparmor/common.sh +# shellcheck source=scripts/system/apparmor/common.sh source "${SCRIPT_DIR}/common.sh" echo "[apparmor] tearing down (dev mode)" diff --git a/scripts/system/network/README.md b/scripts/system/network/README.md new file mode 100644 index 0000000000..a537895922 --- /dev/null +++ b/scripts/system/network/README.md @@ -0,0 +1,10 @@ +# Network Administration + +This is the SPOT for network helpers under `scripts/system/network/`. +Use the child README files for the DNS and IPv6 details. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../docs/contributing/tools/makefile.md). + +## Areas + +- [dns/](dns/) for local DNS setup and teardown +- [ipv6/](ipv6/) for IPv6 enable/restore helpers diff --git a/scripts/system/network/dns/README.md b/scripts/system/network/dns/README.md new file mode 100644 index 0000000000..d65fe42515 --- /dev/null +++ b/scripts/system/network/dns/README.md @@ -0,0 +1,20 @@ +# DNS Helpers + +This is the SPOT for DNS helpers under `scripts/system/network/dns/`. +The folder contains the local name-resolution setup and teardown logic used during development and environment preparation. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../docs/contributing/tools/makefile.md). + +## Areas + +- [setup/](setup/) for DNS setup scripts +- [`remove.sh`](remove.sh) for DNS teardown +- [`common.sh`](common.sh) for shared DNS variables and helper functions + +## Notes + +- Canonical domains and aliases come from `roles/*/config/main.yml` +- The CLI entrypoint lives in `cli/meta/domains/__main__.py` +- The reusable generator logic lives in `utils/domains/list.py` +- `DOMAIN_PRIMARY` is rendered before the list is emitted +- The DNS fallback calls the generator with `--alias --www` +- `INFINITO_DNS_HOSTS` can still override the generated list explicitly diff --git a/scripts/administration/network/dns/common.sh b/scripts/system/network/dns/common.sh similarity index 100% rename from scripts/administration/network/dns/common.sh rename to scripts/system/network/dns/common.sh diff --git a/scripts/administration/network/dns/remove.sh b/scripts/system/network/dns/remove.sh similarity index 93% rename from scripts/administration/network/dns/remove.sh rename to scripts/system/network/dns/remove.sh index 2b2a382dce..2935521256 100755 --- a/scripts/administration/network/dns/remove.sh +++ b/scripts/system/network/dns/remove.sh @@ -2,7 +2,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=scripts/administration/network/dns/common.sh +# shellcheck source=scripts/system/network/dns/common.sh source "${SCRIPT_DIR}/common.sh" echo ">>> Removing local DNS for *.${DNS_DOMAIN}" diff --git a/scripts/administration/network/dns/setup/README.md b/scripts/system/network/dns/setup/README.md similarity index 88% rename from scripts/administration/network/dns/setup/README.md rename to scripts/system/network/dns/setup/README.md index 7f2c8caf9a..a95749b877 100644 --- a/scripts/administration/network/dns/setup/README.md +++ b/scripts/system/network/dns/setup/README.md @@ -31,7 +31,6 @@ WSL2-specific DNS setup. Only executes when running inside a WSL2 environment (d ## ๐Ÿ”— Related -- [`../remove/`](../remove/) โ€” teardown scripts that undo the DNS configuration +- [Makefile Commands](../../../../../docs/contributing/tools/makefile.md) โ€” canonical Make target index for this area +- [`../remove.sh`](../remove.sh) โ€” teardown script that undoes the DNS configuration - [`../common.sh`](../common.sh) โ€” shared variables and helper functions used by `linux.sh` -- `make dns-setup` โ€” invokes `linux.sh` -- `make wsl2-dns-setup` โ€” invokes `wsl.sh` (only on WSL2) diff --git a/scripts/administration/network/dns/setup/linux.sh b/scripts/system/network/dns/setup/linux.sh similarity index 98% rename from scripts/administration/network/dns/setup/linux.sh rename to scripts/system/network/dns/setup/linux.sh index 52702dafcc..71f2e3ece4 100755 --- a/scripts/administration/network/dns/setup/linux.sh +++ b/scripts/system/network/dns/setup/linux.sh @@ -2,7 +2,7 @@ set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -# shellcheck source=scripts/administration/network/dns/common.sh +# shellcheck source=scripts/system/network/dns/common.sh source "${SCRIPT_DIR}/../common.sh" echo ">>> Setting up local DNS for *.${DNS_DOMAIN} -> 127.0.0.1" diff --git a/scripts/administration/network/dns/setup/wsl.sh b/scripts/system/network/dns/setup/wsl.sh similarity index 100% rename from scripts/administration/network/dns/setup/wsl.sh rename to scripts/system/network/dns/setup/wsl.sh diff --git a/scripts/system/network/ipv6/README.md b/scripts/system/network/ipv6/README.md new file mode 100644 index 0000000000..5dc53cf7df --- /dev/null +++ b/scripts/system/network/ipv6/README.md @@ -0,0 +1,11 @@ +# IPv6 Helpers + +This is the SPOT for IPv6 helpers under `scripts/system/network/ipv6/`. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../docs/contributing/tools/makefile.md). + +## Entry Points + +| Script | What it does | +|---|---| +| `disable.sh` | Disables IPv6 for local development. | +| `restore.sh` | Restores the previous IPv6 settings. | diff --git a/scripts/administration/network/ipv6/disable.sh b/scripts/system/network/ipv6/disable.sh similarity index 100% rename from scripts/administration/network/ipv6/disable.sh rename to scripts/system/network/ipv6/disable.sh diff --git a/scripts/administration/network/ipv6/restore.sh b/scripts/system/network/ipv6/restore.sh similarity index 100% rename from scripts/administration/network/ipv6/restore.sh rename to scripts/system/network/ipv6/restore.sh diff --git a/scripts/system/purge/README.md b/scripts/system/purge/README.md new file mode 100644 index 0000000000..c8f73de093 --- /dev/null +++ b/scripts/system/purge/README.md @@ -0,0 +1,17 @@ +# System Purge + +This is the SPOT for host and system cleanup helpers under `scripts/system/purge/`. +For container-local cleanup helpers, see [../../container/purge/README.md](../../container/purge/README.md). +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../docs/contributing/tools/makefile.md). + +## Entry Points + +| Entry point | What it does | Key inputs | Notes | +|---|---|---|---| +| `system.sh` | Runs the broad low-hardware cleanup pass from the repository root. | `PURGE_WINDOWS_CLEANMGR_SETUP` | Best-effort and safe to rerun. | +| `all.sh` | Runs `system.sh` plus the broader repository cleanup bundle. | none directly; inherits `PURGE_WINDOWS_CLEANMGR_SETUP` | Best-effort and safe to rerun; container cleanup needs the local stack. | + +## Script Map + +- [all.sh](all.sh) +- [system.sh](system.sh) diff --git a/scripts/purge/all.sh b/scripts/system/purge/all.sh similarity index 90% rename from scripts/purge/all.sh rename to scripts/system/purge/all.sh index 25893813f6..de92917f7f 100755 --- a/scripts/purge/all.sh +++ b/scripts/system/purge/all.sh @@ -16,14 +16,14 @@ EOF } case "${1:-}" in - -h | --help) - usage - exit 0 - ;; +-h | --help) + usage + exit 0 + ;; esac SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" -REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)" +REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../../.." && pwd)" cd "${REPO_ROOT}" diff --git a/scripts/purge/system.sh b/scripts/system/purge/system.sh similarity index 98% rename from scripts/purge/system.sh rename to scripts/system/purge/system.sh index db43ad6073..e6ad2d0674 100755 --- a/scripts/purge/system.sh +++ b/scripts/system/purge/system.sh @@ -19,14 +19,14 @@ EOF } case "${1:-}" in - -h | --help) - usage - exit 0 - ;; +-h | --help) + usage + exit 0 + ;; esac SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" -REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../.." && pwd)" +REPO_ROOT="$(cd -- "${SCRIPT_DIR}/../../.." && pwd)" cd "${REPO_ROOT}" diff --git a/scripts/administration/systemd/README.md b/scripts/system/systemd/README.md similarity index 73% rename from scripts/administration/systemd/README.md rename to scripts/system/systemd/README.md index 7744fbb3d3..9469925192 100644 --- a/scripts/administration/systemd/README.md +++ b/scripts/system/systemd/README.md @@ -1,6 +1,7 @@ # โš™๏ธ systemd Administration Scripts This directory contains scripts for managing systemd across different platforms and environments used in Infinito Nexus development. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../docs/contributing/tools/makefile.md). --- @@ -13,7 +14,3 @@ Platform-specific scripts for enabling systemd where it is not active by default - **`wsl2.sh`** โ€” enables systemd as the WSL2 init system via `/etc/wsl.conf` and restarts WSL2 if needed --- - -## ๐Ÿ”— Related - -- `make wsl2-systemd-check` โ€” top-level Make target for WSL2 systemd setup diff --git a/scripts/administration/systemd/enable/README.md b/scripts/system/systemd/enable/README.md similarity index 83% rename from scripts/administration/systemd/enable/README.md rename to scripts/system/systemd/enable/README.md index ba8d7654a7..285d133fe7 100644 --- a/scripts/administration/systemd/enable/README.md +++ b/scripts/system/systemd/enable/README.md @@ -1,6 +1,7 @@ # โœ… systemd โ€” Enable This directory contains platform-specific scripts for enabling systemd in environments where it is not active by default. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../docs/contributing/tools/makefile.md). --- @@ -22,4 +23,3 @@ Enables systemd as the WSL2 init system by writing `systemd=true` into `/etc/wsl ## ๐Ÿ”— Related - [`../`](../) โ€” systemd administration scripts -- `make wsl2-systemd-check` โ€” Make target that invokes this script diff --git a/scripts/administration/systemd/enable/wsl2.sh b/scripts/system/systemd/enable/wsl2.sh similarity index 83% rename from scripts/administration/systemd/enable/wsl2.sh rename to scripts/system/systemd/enable/wsl2.sh index 457782ac63..220933a9ed 100755 --- a/scripts/administration/systemd/enable/wsl2.sh +++ b/scripts/system/systemd/enable/wsl2.sh @@ -18,7 +18,7 @@ if grep -qs "systemd=true" /etc/wsl.conf 2>/dev/null; then echo ">>>" echo ">>> wsl --shutdown" echo ">>>" - echo ">>> Then reopen Ubuntu and run: make dev-environment-bootstrap" + echo ">>> Then reopen Ubuntu and run: make environment-bootstrap" exit 1 fi @@ -32,11 +32,11 @@ else fi echo ">>> Restarting WSL2 to apply changes..." -echo ">>> Please reopen this terminal and run: make dev-environment-bootstrap" +echo ">>> Please reopen this terminal and run: make environment-bootstrap" /mnt/c/Windows/System32/wsl.exe --shutdown 2>/dev/null || { echo "" echo ">>> Could not auto-restart WSL2." - echo ">>> Run this in Windows PowerShell, then re-run make:" + echo ">>> Run this in Windows PowerShell, then re-run make environment-bootstrap:" echo ">>> wsl --shutdown" } diff --git a/scripts/administration/tls/README.md b/scripts/system/tls/README.md similarity index 80% rename from scripts/administration/tls/README.md rename to scripts/system/tls/README.md index aaa8fc8ccf..eb6aaddd56 100644 --- a/scripts/administration/tls/README.md +++ b/scripts/system/tls/README.md @@ -1,6 +1,7 @@ # ๐Ÿ”’ TLS Administration Scripts This directory contains scripts for managing TLS/PKI concerns in the Infinito Nexus development environment. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../docs/contributing/tools/makefile.md). --- @@ -17,5 +18,4 @@ Scripts for installing the Infinito self-signed Root CA into the trust stores of ## ๐Ÿ”— Related -- `make trust-ca` โ€” top-level Make target that triggers CA trust installation - `roles/sys-ca-selfsigned/` โ€” role that generates the self-signed Root CA inside the container diff --git a/scripts/administration/tls/trust/README.md b/scripts/system/tls/trust/README.md similarity index 90% rename from scripts/administration/tls/trust/README.md rename to scripts/system/tls/trust/README.md index 3e768441f8..b406b2a27a 100644 --- a/scripts/administration/tls/trust/README.md +++ b/scripts/system/tls/trust/README.md @@ -1,6 +1,7 @@ # ๐Ÿ” CA Trust Scripts This directory contains platform-specific scripts for trusting the Infinito Root CA certificate on the developer's machine. +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../docs/contributing/tools/makefile.md). All scripts extract the Root CA from a running Infinito container and install it into the appropriate system trust store, so that browsers and tools accept `*.infinito.example` TLS certificates without warnings. @@ -32,5 +33,4 @@ Trusts the Infinito Root CA on **Windows** from inside a WSL2 environment. Only ## ๐Ÿ”— Related - [`../`](../) โ€” TLS administration scripts -- `make trust-ca` โ€” runs `linux.sh` (and `wsl2.sh` on WSL2) - `roles/sys-ca-selfsigned/` โ€” generates the self-signed Root CA inside the container diff --git a/scripts/administration/tls/trust/linux.sh b/scripts/system/tls/trust/linux.sh similarity index 100% rename from scripts/administration/tls/trust/linux.sh rename to scripts/system/tls/trust/linux.sh diff --git a/scripts/administration/tls/trust/wsl2.sh b/scripts/system/tls/trust/wsl2.sh similarity index 100% rename from scripts/administration/tls/trust/wsl2.sh rename to scripts/system/tls/trust/wsl2.sh diff --git a/scripts/tests/deploy/act/README.md b/scripts/tests/deploy/act/README.md index 40f21d43fc..ef1265a753 100644 --- a/scripts/tests/deploy/act/README.md +++ b/scripts/tests/deploy/act/README.md @@ -3,11 +3,12 @@ This is the SPOT for executable act deploy flows under `scripts/tests/deploy/act/`. For local deploy flows, use [../local/README.md](../local/README.md). +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../../docs/contributing/tools/makefile.md). ## Entry Points | Command | What it does | Notes | |---|---|---| -| `make act-all` / `all.sh` | Runs `test-deploy-local.yml` across all selected distros. | Uses a linear matrix and passes the selected distro list through `DISTROS`. | -| `make act-app` / `app.sh` | Runs `test-deploy-local.yml` for one app. | Uses `whitelist` to limit the workflow to the selected app. | -| `make act-workflow` / `workflow.sh` | Runs any workflow file through `act`. | Supports custom job, matrix, container, network, and image settings. | +| `all.sh` | Runs `test-deploy-local.yml` across all selected distros. | Uses a linear matrix and passes the selected distro list through `DISTROS`. | +| `app.sh` | Runs `test-deploy-local.yml` for one app. | Uses `whitelist` to limit the workflow to the selected app. | +| `workflow.sh` | Runs any workflow file through `act`. | Supports custom job, matrix, container, network, and image settings. | diff --git a/scripts/tests/deploy/local/README.md b/scripts/tests/deploy/local/README.md index 8b61b4bdac..62e0990327 100644 --- a/scripts/tests/deploy/local/README.md +++ b/scripts/tests/deploy/local/README.md @@ -5,6 +5,7 @@ For executable local deploy flows, use [deploy/README.md](deploy/README.md). For inventory reset helpers, use [reset/README.md](reset/README.md). For cleanup helpers, use [purge/README.md](purge/README.md). For container exec helpers, use [exec/README.md](exec/README.md). +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../docs/contributing/tools/makefile.md). ## Prerequisites diff --git a/scripts/tests/deploy/local/deploy/README.md b/scripts/tests/deploy/local/deploy/README.md index da0e448f66..46825628dc 100644 --- a/scripts/tests/deploy/local/deploy/README.md +++ b/scripts/tests/deploy/local/deploy/README.md @@ -3,6 +3,7 @@ This is the SPOT for executable local deploy flows under `scripts/tests/deploy/local/deploy/`. For other local helpers, use [../README.md](../README.md). +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../../docs/contributing/tools/makefile.md). ## Prerequisites @@ -23,8 +24,8 @@ For other local helpers, use [../README.md](../README.md). | Entry point | What it does | Key inputs | Notes | |---|---|---|---| -| `make deploy-fresh-kept-all` / `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. | -| `make deploy-reuse-kept-all` / `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`. | -| `make deploy-fresh-kept-app` / `fresh-kept-app.sh ` | Creates `devices.yml` for one app and deploys it. | `APP=` | Single-app init and deploy path. | -| `make deploy-reuse-kept-app` / `reuse-kept-app.sh` | Runs a targeted `infinito deploy dedicated` for one app. | `APP`, `TEST_DEPLOY_TYPE`, `INFINITO_CONTAINER`, `DEBUG`, `INVENTORY_DIR` | Reuses `devices.yml`. | -| `make deploy-fresh-purged-app` / `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`, `APP` | Baseline and recovery path. | +| `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. | `APP=` | Single-app init and deploy path. | +| `reuse-kept-app.sh` | Runs a targeted `infinito deploy dedicated` for one app. | `APP`, `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`, `APP` | Baseline and recovery path. | diff --git a/scripts/tests/deploy/local/deploy/fresh-kept-all.sh b/scripts/tests/deploy/local/deploy/fresh-kept-all.sh old mode 100644 new mode 100755 diff --git a/scripts/tests/deploy/local/deploy/fresh-kept-app.sh b/scripts/tests/deploy/local/deploy/fresh-kept-app.sh old mode 100644 new mode 100755 diff --git a/scripts/tests/deploy/local/deploy/fresh-purged-app.sh b/scripts/tests/deploy/local/deploy/fresh-purged-app.sh old mode 100644 new mode 100755 diff --git a/scripts/tests/deploy/local/deploy/reuse-kept-all.sh b/scripts/tests/deploy/local/deploy/reuse-kept-all.sh old mode 100644 new mode 100755 diff --git a/scripts/tests/deploy/local/deploy/reuse-kept-app.sh b/scripts/tests/deploy/local/deploy/reuse-kept-app.sh old mode 100644 new mode 100755 diff --git a/scripts/tests/deploy/local/exec/README.md b/scripts/tests/deploy/local/exec/README.md index 511f3ad90e..72677facd1 100644 --- a/scripts/tests/deploy/local/exec/README.md +++ b/scripts/tests/deploy/local/exec/README.md @@ -2,12 +2,13 @@ This is the SPOT for container execution helpers under `scripts/tests/deploy/local/exec/`. For other local helpers, use [../README.md](../README.md). +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../../docs/contributing/tools/makefile.md). ## Entry Points | Entry point | What it does | Key inputs | Notes | |---|---|---|---| -| `make exec` / `container.sh` | Opens an interactive shell in the running container or runs a one-off command. | `INFINITO_DISTRO`, `INFINITO_CONTAINER`, optional `INSPECT_CMD` or positional args | Uses `docker exec` against the live `infinito` container. | +| `container.sh` | Opens an interactive shell in the running container or runs a one-off command. | `INFINITO_DISTRO`, `INFINITO_CONTAINER`, optional `INSPECT_CMD` or positional args | Uses `docker exec` against the live `infinito` container. | ## Script Map diff --git a/scripts/tests/deploy/local/purge/README.md b/scripts/tests/deploy/local/purge/README.md index 39c58c60c6..1ca8968ff1 100644 --- a/scripts/tests/deploy/local/purge/README.md +++ b/scripts/tests/deploy/local/purge/README.md @@ -2,14 +2,16 @@ This is the SPOT for cleanup helpers under `scripts/tests/deploy/local/purge/`. For other local helpers, use [../README.md](../README.md). +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../../docs/contributing/tools/makefile.md). ## Entry Points | Entry point | What it does | Key inputs | Notes | |---|---|---|---| -| `make container-purge-entity` / `entity.sh` | Purges one or more app entities inside the running container. | `APP`, `INFINITO_CONTAINER` | Used by `make deploy-reuse-purged-app`. | -| `make deploy-reuse-purged-app` | Purges the app entity and then reruns `deploy-reuse-kept-app`. | `APP`, `TEST_DEPLOY_TYPE`, `INFINITO_CONTAINER`, `DEBUG`, `INVENTORY_DIR` | Reuses the existing `devices.yml` inventory. | -| `make container-purge-system` / `inventory.sh` / `web.sh` / `lib.sh` | Removes inventory, web config, and lib state in the running container. | `INFINITO_CONTAINER`, `INVENTORY_DIR` | Destructive cleanup. | +| `entity.sh` | Purges one or more app entities inside the running container. | `APP`, `INFINITO_CONTAINER` | Used by the deployment cleanup helpers. | +| `inventory.sh` | Removes the inventory directory in the running container. | `INFINITO_CONTAINER`, `INVENTORY_DIR` | Destructive cleanup. | +| `web.sh` | Removes nginx config and self-signed CA state in the running container. | `INFINITO_CONTAINER` | Destructive cleanup. | +| `lib.sh` | Removes the container lib state. | `INFINITO_CONTAINER` | Destructive cleanup. | ## Script Map diff --git a/scripts/tests/deploy/local/purge/entity.sh b/scripts/tests/deploy/local/purge/entity.sh index 3cebbf41a9..5668e130b6 100755 --- a/scripts/tests/deploy/local/purge/entity.sh +++ b/scripts/tests/deploy/local/purge/entity.sh @@ -71,5 +71,5 @@ docker exec "${INFINITO_CONTAINER}" bash -lc " fi echo \">>> Purging entities: \${entities[*]}\" - bash /opt/src/infinito/scripts/administration/purge/entity/all.sh \"\${entities[@]}\" || true + bash /opt/src/infinito/scripts/container/purge/entity/all.sh \"\${entities[@]}\" || true " diff --git a/scripts/tests/deploy/local/purge/web.sh b/scripts/tests/deploy/local/purge/web.sh index 81a1aed52f..79850e047b 100755 --- a/scripts/tests/deploy/local/purge/web.sh +++ b/scripts/tests/deploy/local/purge/web.sh @@ -3,5 +3,5 @@ set -euo pipefail docker exec "${INFINITO_CONTAINER}" bash -lc " echo \">>> Cleaning up Nginx configuration files\" - bash /opt/src/infinito/scripts/administration/purge/web.sh || true + bash /opt/src/infinito/scripts/container/purge/web.sh || true " diff --git a/scripts/tests/deploy/local/reset/README.md b/scripts/tests/deploy/local/reset/README.md index fc41743e47..82c05dba72 100644 --- a/scripts/tests/deploy/local/reset/README.md +++ b/scripts/tests/deploy/local/reset/README.md @@ -2,12 +2,13 @@ This is the SPOT for inventory refresh helpers under `scripts/tests/deploy/local/reset/`. For other local helpers, use [../README.md](../README.md). +For the canonical Make target index that invokes these helpers, see [docs/contributing/tools/makefile.md](../../../../../docs/contributing/tools/makefile.md). ## Entry Points | Entry point | What it does | Key inputs | Notes | |---|---|---|---| -| `make container-refresh-inventory` / `inventory.sh` | Recreates `devices.yml` for all discovered apps without deploying them. | `INFINITO_DISTRO`, `TEST_DEPLOY_TYPE`, `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`, `TEST_DEPLOY_TYPE`, `INVENTORY_DIR` | Rebuilds the local inventory and keeps the runtime `.password` file. | ## Script Map diff --git a/scripts/tests/development.sh b/scripts/tests/development.sh index 1afe8ba66e..c60b2f7831 100755 --- a/scripts/tests/development.sh +++ b/scripts/tests/development.sh @@ -10,7 +10,7 @@ cd "${REPO_ROOT}" bash "${REPO_ROOT}/scripts/install/package.sh" make install -make dev-environment-bootstrap +make environment-bootstrap make up make test make deploy-fresh-purged-app APP="${APP}" @@ -22,4 +22,4 @@ echo "Checking matomo URL: ${MATOMO_URL}" curl -sS -o /dev/null -w '%{http_code}\n' "${MATOMO_URL}" | grep -qx '200' make down -make dev-environment-teardown +make environment-teardown