Johannes Kirschbauer
f210b2f9a6
refactor: move clan_cli.error to clan_lib.error
2025-05-16 16:14:39 +02:00
Jörg Thalheim
2240a3a533
rename nix_shell_legacy to nix_shell and run_cmd to nix_shell
...
Than it's more obvious that we need to migrate.
2025-04-16 18:27:01 +00:00
DavHau
60133015f5
add CLAN_NO_COMMIT env var to disable committing
...
This is required when calling vars generators for generating vars for
tests
2025-04-07 18:59:19 +07:00
Jörg Thalheim
e0b18c1579
fix committing in git worktree
...
fixes https://git.clan.lol/clan/clan-core/issues/2636
2024-12-25 22:51:53 +01:00
Qubasa
d2719f3179
clan-cli: cmd.run now has its options extracted to a dataclass
2024-11-28 15:26:37 +01:00
Jörg Thalheim
15ff74f7c2
enable ASYNC, DTZ, YTT and EM lints
2024-09-02 14:07:06 +02:00
Jörg Thalheim
af4b9cc2d5
make all same-module imports relative, the rest absolute
...
This makes sorting more consitent.
2024-09-02 13:00:19 +02:00
Jörg Thalheim
3583c25c67
fix error message when removing secrets
2024-07-24 20:21:10 +02:00
Johannes Kirschbauer
580cc12671
cli: Disable pre-commit hooks for cli commands
2024-07-24 10:34:10 +02:00
DavHau
75b969b1ad
clan-cli: improve runtime dependency management
...
Many dependencies of clan-cli are currently dynamically loaded via nix-shell on each execution.
This is nice, as it reduces the initial closure size of clan, but the overhead introduced by nix-shell piles up quickly, as some commands shell out many times during their lifetime. For example, when adding a secret git is called 10+ times.
This reduces the time of a test which adds a secret from around 50 seconds to 15 seconds.
- add run_cmd() as an alternative to nix_shell()
- introduce the concept of static dependencies which do not need to go through nix-shell
- static dependencies are defined at build time and included into the wrapper for clan-cli
- add package: clan-cli-full which statically ships all required dependencies
TODO: deprecate nix_shell() in favor of run_cmd()
2024-07-11 15:34:41 +07:00
DavHau
cf67de2f69
secrets: ensure all added/deleted files get committed
2024-04-24 17:26:32 +07:00
Jörg Thalheim
f385e0e037
refactor facts command to regenerate facts for all machines
2024-04-15 22:14:54 +02:00
Jörg Thalheim
52fcc91479
Also commit files when adding machines/users or removing secrets
2024-02-22 16:12:11 +01:00
lassulus
8114cebaa4
clan-cli git: add commit_files function
2024-02-05 10:03:10 +01:00
Qubasa
0133ccd5f7
Fixed missing log.BOTH and error_msg at prev refactors
2024-01-11 21:11:49 +01:00
Qubasa
64846eb395
Fixed bug, where exception is raised where there shouldn't be raised one
2024-01-10 18:46:54 +01:00
Qubasa
b36d0be524
cmd.py part 3 refactor
2024-01-10 18:39:19 +01:00
Jörg Thalheim
1496f45fe2
prefix nixpkgs# explicitly in nix_shell
...
This makes the function usage less confusing (you can now tell from the call side what are flags and what is passed to nix-shell) and allows to use different flakes to download packages.
2023-12-08 15:14:14 +01:00
Jörg Thalheim
f1b223d0a1
modernisation for python 3.11
2023-11-29 13:29:45 +00:00
DavHau
14c4b99891
commit_file: fix diff computation
...
previously computed diff over all files
2023-11-13 19:59:20 +07:00
Qubasa
f9b1a8fa89
Removing find_git_repo
2023-10-27 19:26:03 +02:00
Jörg Thalheim
0d42c549b0
git: dont pass additional cwd
2023-09-22 16:52:11 +02:00
Jörg Thalheim
b482dcd466
make git idempotent
2023-09-22 16:38:46 +02:00
Jörg Thalheim
d9fd0e2a65
better error messages if git commands fail
2023-09-22 16:25:30 +02:00
Jörg Thalheim
e3b2424d9d
make git optional again
2023-09-22 16:07:39 +02:00
DavHau
0196fd72c3
git.commit_file: fix file path & repo path finding
2023-09-22 13:42:04 +02:00
DavHau
6a359c0a2f
clan-cli: add git.commit_file() to auto commit files if inside a git
...
- commit only if inside a git repo
- commit only the specified file and nothing else
- auto-generate commit message if not specified
2023-09-21 14:07:54 +02:00