Commit Graph
26 Commits
Author SHA1 Message Date
kevinveenbirkenbach ffd071c64e ci(openresty): share gh-action runtime and scope nginx/www volumes per CI run
- Mount /tmp/gh-action into the CI container so Docker can access run-scoped paths
- Scope OpenResty www and nginx volumes to GITHUB_RUN_ID when running in container
- Avoid leaking host /etc/nginx and /var/www into CI runs
- Remove redundant preflight

https://chatgpt.com/share/694918d0-53b4-800f-93a7-ec82946f3e24
2025-12-22 11:09:12 +01:00
kevinveenbirkenbach 1fdf5ae169 fix(openresty): make restart handler safe with include_tasks and assertions
- Move OpenResty restart logic into included handler tasks
- Use block/rescue to dump container logs on failure
- Tolerate restarting state during pre-flight validation
- Wait up to 2 minutes for container to reach running state
- Add explicit change detection for docker restart
- Enable assert mode in container deploy CLI

https://chatgpt.com/share/6948fa05-1970-800f-a010-59c8c3588713
2025-12-22 09:40:08 +01:00
kevinveenbirkenbach d9824bb506 test(deploy): mock backup authorized_keys in CI inventory
Create a dummy authorized_keys file inside the CI container inventory
after inventory generation and before ansible-playbook execution.

This prevents sys-bkp-provider-user from failing on missing file lookups
while keeping the role logic unchanged and the deploy tests deterministic.
2025-12-21 23:39:20 +01:00
kevinveenbirkenbach d2e88b6a8c feat(cli): eliminate runpy warnings for inventory + container entrypoints
* Remove legacy **main** re-export wrappers to avoid `runpy` "already in sys.modules" warnings
* Introduce `cli.deploy.container.command` as the stable implementation module
* Reduce `cli.deploy.container.__main__` to a minimal entrypoint delegating to `command.main`
* Re-export container helpers from package `__init__` without importing `__main__`
* Update unit tests to import/patch the new command module and keep CLI dispatch stable

https://chatgpt.com/share/69484a22-60dc-800f-a23d-068d7c45fe37
2025-12-21 20:27:26 +01:00
kevinveenbirkenbach 1fe0a420fa fix(cli): avoid runpy warnings by moving logic into command modules
Stop importing __main__ from package __init__.py to prevent runpy RuntimeWarning when using `python -m`.

- Move CLI logic into command.py modules
- Keep __main__.py as thin wrappers
- Update unit tests to import command modules directly

https://chatgpt.com/share/6947fb8e-550c-800f-8323-e36f92cb5bba
2025-12-21 14:52:09 +01:00
kevinveenbirkenbach ce19fed69a Increased verbosity 2025-12-21 11:52:04 +01:00
kevinveenbirkenbach e23187bccb refactor(deploy): remove skip-tests option from dedicated deploy
- Drop --skip-tests CLI flag and runner parameter
- Remove test phase execution from deploy workflow
- Update unit tests to match simplified deploy flow

https://chatgpt.com/share/69473607-22e4-800f-845b-a628677fb8b9
2025-12-21 00:49:21 +01:00
kevinveenbirkenbach 103659a534 refactor(deploy): modularize dedicated deploy CLI and fix make cwd issue
- Split dedicated deploy logic into focused modules (apps, modes, paths, proc, runner)
- Ensure all make targets run from the repository root via explicit cwd handling
- Fix "make: No rule to make target" errors caused by incorrect working directory
- Slim down __main__ to a thin CLI entrypoint
- Rework unit tests into one file per module and expand coverage

https://chatgpt.com/share/69472632-9740-800f-962c-bcb4474963d6
2025-12-20 23:41:41 +01:00
kevinveenbirkenbach 378d41e9fb Optimized path 2025-12-20 23:08:58 +01:00
kevinveenbirkenbach a354992f27 refactor(create-inventory): modularize CLI, stabilize path handling, add unit tests
- Split create-inventory logic into focused modules (cli, project, filters, host_vars, credentials, etc.)
- Replace fragile path construction with python -m module execution
- Add robust project root detection
- Centralize password generation
- Improve test coverage with per-module unit tests
- Preserve existing inventory and host_vars behavior

https://chatgpt.com/share/69471157-79c0-800f-8dec-25c0f8e38f03
2025-12-20 22:12:44 +01:00
kevinveenbirkenbach 20d03575e7 fix(deploy): mount project root instead of cli/deploy in CI container
https://chatgpt.com/share/6946f9a9-bf94-800f-adab-f1baf49e1e12
2025-12-20 20:37:10 +01:00
kevinveenbirkenbach 2e6d973839 fix(build): align CLI module invocations and stabilize include generation
- Switch Makefile targets to direct module execution (cli.build.*)
- Remove obsolete flags and normalize tree invocation
- Minor formatting cleanups for readability and test stability
- Keep inventory and include paths consistent after package layout migration

https://chatgpt.com/share/6946eac4-eb48-800f-becb-f08420ab03a6
2025-12-20 19:28:14 +01:00
kevinveenbirkenbach a8a4948e39 **fix(cli): restore test patchability after package migration**
* Reintroduced proxy wrappers in cli subcommands to keep unit/integration tests patchable
* Synced test monkeypatches with **main** implementations (tree, deploy, fix, users)
* Fixed ROLES_DIR resolution to repo root after package refactor
* Re-exported private helpers required by tests
* Made cli/setup/users script-safe when executed directly

https://chatgpt.com/share/6946e285-2658-800f-b8f3-b68d66b91be9
2025-12-20 18:52:56 +01:00
kevinveenbirkenbach 102735dba4 Renamed inventory.py to inventory/__main__.py 2025-12-20 18:30:20 +01:00
kevinveenbirkenbach 5c6afd2cf6 p2pkg executed 2025-12-20 18:25:37 +01:00
kevinveenbirkenbach 0ea828ab6e cleanup: unify git cleanup, simplify deploy flow, fix dockerignore
- Remove clean-keep-logs target and enforce git-repo guard in Makefile
- Always use `make clean` during deploy cleanup with live output
- Add shared subprocess runner for consistent stdout/stderr handling
- Align unit tests with simplified cleanup semantics
- Fix .dockerignore to ignore build artifacts and Ruff cache correctly

https://chatgpt.com/share/6945784a-daac-800f-bc02-d7e8d3087376
2025-12-19 17:07:33 +01:00
kevinveenbirkenbach f775ae9dfa ci(deploy): run deploy tests with --missing and docker-based invokable excludes 2025-12-19 16:07:59 +01:00
kevinveenbirkenbach aea82e8080 ci(deploy): use host Docker socket and local infinito image for deploy tests
- Install Docker CLI in the Docker image (distro-aware)
- Switch deploy container runner from Docker-in-Docker to host /var/run/docker.sock
  with clearer diagnostics when docker/permissions are missing
- Rewrite scripts/tests/deploy.sh to build a local infinito-<distro> image via Make
  and run deployment strictly against that local tag (no pkgmgr/GHCR pulls)

https://chatgpt.com/share/694513c7-daec-800f-a9b5-c8fb25274958
2025-12-19 09:58:43 +01:00
kevinveenbirkenbach 9047285e7a Fix CodeQL warning by avoiding implicit string concatenation in sh -c command
https://chatgpt.com/share/6943f9b0-7dd4-800f-9259-da3c9c4bf156
2025-12-18 13:54:55 +01:00
kevinveenbirkenbach 7123841fb4 style: apply ruff autoformat 2025-12-17 16:37:21 +01:00
kevinveenbirkenbach 6c3a6d9b20 Implemented correct path 2025-12-17 12:14:11 +01:00
kevinveenbirkenbach 14548cbc52 Replaced false make messy-build by make setup 2025-12-16 20:51:37 +01:00
kevinveenbirkenbach d0882433c8 Refactor setup workflow and make install robust via virtualenv
- Introduce a dedicated Python virtualenv (deps target) and run all setup scripts through it
- Fix missing PyYAML errors in clean, CI, and Nix environments
- Refactor build defaults into cli/setup for clearer semantics
- Make setup deterministic and independent from system Python
- Replace early Makefile shell expansion with runtime evaluation
- Rename messy-test to test-messy and update deploy logic and tests accordingly
- Keep setup and test targets consistent across Makefile, CLI, and unit tests

https://chatgpt.com/share/693de226-00ac-800f-8cbd-06552b2f283c
2025-12-13 23:00:13 +01:00
kevinveenbirkenbach d0aac64c67 Refactor CI container deploy wrapper: add modes, rebuild/no-cache flags, and transparent inventory/deploy arg forwarding; update tests accordingly (see ChatGPT conversation: https://chatgpt.com/share/6931e58c-2ddc-800f-88d2-f7887ec13e25) 2025-12-04 20:49:04 +01:00
kevinveenbirkenbach f2ace362bc Refactor container deploy pipeline:
- Replace inline shell scripts with Python-driven orchestration
- Introduce inner dockerd started via detached docker run
- Add docker exec–based inventory creation and dedicated deploy execution
- Add automatic vault password generation for CI
- Update GitHub Actions workflow to use new container deploy wrapper
- Add complete unit test suite for container deploy behavior
- Fix CLI argument forwarding and ensure single docker run call

Conversation reference:
https://chatgpt.com/share/6931c45d-4e40-800f-852f-6c9b1f7dc281
2025-12-04 18:27:15 +01:00
kevinveenbirkenbach 8c64f91a6d Refactor deploy CLI into cli/deploy/dedicated.py, add package inits, and update unit tests (see ChatGPT conversation: https://chatgpt.com/share/6931af9e-dad0-800f-9a8f-6d01c373de87) 2025-12-04 16:59:13 +01:00