Johannes Kirschbauer
fe0507b47c
refactor: move clan_cli.error to clan_lib.error
2025-05-16 16:14:39 +02:00
Jörg Thalheim
837789010e
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
d7c3039666
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
6dac0cfe42
fix committing in git worktree
...
fixes https://git.clan.lol/clan/clan-core/issues/2636
2024-12-25 22:51:53 +01:00
Qubasa
1f98df96e3
clan-cli: cmd.run now has its options extracted to a dataclass
2024-11-28 15:26:37 +01:00
Jörg Thalheim
e150b37fb8
enable ASYNC, DTZ, YTT and EM lints
2024-09-02 14:07:06 +02:00
Jörg Thalheim
b313f2d066
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
87a78ac6a8
fix error message when removing secrets
2024-07-24 20:21:10 +02:00
Johannes Kirschbauer
a4bdc10462
cli: Disable pre-commit hooks for cli commands
2024-07-24 10:34:10 +02:00
DavHau
430adc875a
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
e09658c817
secrets: ensure all added/deleted files get committed
2024-04-24 17:26:32 +07:00
Jörg Thalheim
033e5194fb
refactor facts command to regenerate facts for all machines
2024-04-15 22:14:54 +02:00
Jörg Thalheim
79e956b5c3
Also commit files when adding machines/users or removing secrets
2024-02-22 16:12:11 +01:00
lassulus
0a89abef89
clan-cli git: add commit_files function
2024-02-05 10:03:10 +01:00
Qubasa
3ed58de082
Fixed missing log.BOTH and error_msg at prev refactors
2024-01-11 21:11:49 +01:00
Qubasa
50781d6cf0
Fixed bug, where exception is raised where there shouldn't be raised one
2024-01-10 18:46:54 +01:00
Qubasa
513f48bab1
cmd.py part 3 refactor
2024-01-10 18:39:19 +01:00
Jörg Thalheim
0e91f8721f
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
6f0722c692
modernisation for python 3.11
2023-11-29 13:29:45 +00:00
DavHau
52af144135
commit_file: fix diff computation
...
previously computed diff over all files
2023-11-13 19:59:20 +07:00
Qubasa
a628934351
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