Commit Graph

92 Commits

Author SHA1 Message Date
697763b17e client: lib_docker: return compose error code
Returns code of compose failure or if `run`'s container returns error.
2026-01-28 15:22:21 -08:00
e2d6330669 client: lib_gen: generate custom plugin layout for all images
Previously only generated for the finance image.
2026-01-28 11:30:10 -08:00
cc3226a5ea client: lib_env: allow non-root system user; print warning
Needed for CI.
2026-01-28 11:16:34 -08:00
fcb5b1fa92 client: lib_docker: up: only allocate pseudo-TTY when needed 2026-01-21 14:25:33 -08:00
7b15588681 client: lib_docker: exec: only allocate pseudo-TTY when needed 2026-01-21 12:36:46 -08:00
592e08efb8 client: lib_docker: dev-tools: use fatal error for invalid build types 2026-01-21 11:34:52 -08:00
e9aa72c64a client: dev-tools: lib_linter: php-cs-fixer: add given-file(s) init, refactor 2026-01-15 10:57:13 -08:00
0c9cfa07ba client: dev-tools: lib_linter: refactor with lib_docker::exec 2026-01-15 10:32:14 -08:00
76755f1032 client: dev-tools: lib_linter: php-cs-fixer: add init
php-cs-fixer's 3.92 series requires `init` before `fix`ing or `check`ing
2026-01-15 10:19:49 -08:00
221a5f7049 client: docker: add exec wrapper, update completion 2025-11-25 15:51:05 -08:00
0266157abe client/container: usage help updates 2025-10-28 12:13:10 -07:00
b130f22318 client: completion: add update command 2025-10-08 13:37:45 -07:00
9eca664dc8 client: docker/lib_docker: add update feature
Simply rebuilds image without cache because modules are built locally
(meaning, there's no "newer version" image of modules to pull against).
2025-10-07 11:46:27 -07:00
c7b438aa1b client: dev-tools: lib_linter: fix finding .clang-format
Trailing slash is needed for when client bind-mount is a symlink.
2025-09-19 13:05:45 -07:00
5e7453d468 client: lib_linter: specify .clang-format location
This commit allows *custom* C++ plugins to be linted/formatted in the
same way as their repo counterparts (using the same repo rulesets).

Previously, when runing the linter, only *repo* C++ plugins would be
formatted. Since custom plugin formatting for both Bash and PHP are
already in place, this simply extends the feature to C++.
2025-08-19 14:17:42 -07:00
8fed7f8c54 client: lib_docker: make fatal if user not given 2025-08-12 11:03:40 -07:00
c2789f54db client: docker: don't make fatal for empty/invalid command 2025-08-12 11:02:10 -07:00
38391e03c7 client: lib_env: fix handling of global command 2025-08-12 11:02:07 -07:00
fd338b60f6 client: docker/lib_docker: make fatal for unsupported platform 2025-08-12 11:02:04 -07:00
051f8fc4f7 client: src: completion: fix for when Docker is not found
Per current default install instructions; as this is appended to either
the per-interactive-shell startup file or aliases file, if Docker is not
installed or is not found, without this fix, the end-user will either be
effectively locked out of their session (after logging out) or they will
not be able to start a new shell within their current session...
2025-05-14 12:49:48 -07:00
050d95b60b client: src: lib_docker: run: only allocate TTY when needed
Fixes running with client (host) cron.
2025-03-21 10:47:20 -07:00
301ad39c1a client/container: refactor w/ updated global basename 2024-12-24 01:46:20 -08:00
ed57dc0749 client/container: use 'dfi' as global basename
Aligned with installation, will make usage help clearer.
2024-12-24 01:46:20 -08:00
7517488943 client: src: docker.bash: fix typo in usage help 2024-12-18 21:44:36 -08:00
c8611edacb client/container: src: completion: plugins enhancements
- Re-enables space after completion for plugin arguments
- Ignores internal/implementation files when completing
  * Files must be within an 'internal'/'impl' directory
2024-10-09 21:13:36 -07:00
d965a11b3e client: src: lib_gen: refactor profile variables
Makes clearer their respective roles.
2024-10-09 21:09:46 -07:00
01197a2818 client/container: implement debug log-levels
DOCKER_FINANCE_DEBUG will now support the following:

0 = no debug output
1 = `print_debug` (bash/PHP)
2 = level 1 + `set -xv` (bash)
2024-09-26 18:38:36 -07:00
bfdc2452da client: src: lib_gen: filter custom Dockerfile's .in files
Adds filter to remove noisy license clutter in custom Dockerfile output.

This is needed because of the amount of `edit` used on the file.

The license still applies, regardless.
2024-09-25 21:15:03 -07:00
4a836a77c4 client: src: lib_gen: filter container config .in files
Adds filters to remove noisy license clutter in configuration output.

This is needed because of the amount of `edit` used on configurations.

The license still applies, regardless.
2024-09-24 19:58:21 -07:00
ae2c08d5df client: src: lib_docker: filter docker related .in files
Creates a clutter-free finalized Dockerfile and docker-compose.yml by
removing all comments and blank lines.
2024-09-24 19:57:44 -07:00
e6ccd9607c client: completion: add gen arguments 2024-09-23 17:31:12 -07:00
f2102c7b90 client: src: lib_gen: reduce prompt language verbosity 2024-09-23 17:31:11 -07:00
169034cbe2 client: src: lib_gen: refactor/update editor related
- Creates a reusable editor function
- Skipping confirmations will also skip opening up the editor
  * Allows for complete generation without intentional interruption
2024-09-23 17:31:11 -07:00
0ec42d2420 client: rename $global_shell_file -> $global_superscript
Provides clarity, avoids confusion.
2024-09-23 17:31:11 -07:00
51bf587ceb client/container: rename 'subprofile' script to 'subscript'
- Provides clarity, avoids confusion (subprofile.bash -> subscript.bash)

- Changes filename in superscript source
  * End-user must update with client command `edit type=superscript`

- Changes filename in flow subprofile's docker-finance.d
  * Pre-existing subprofiles must manually rename their subscript file
2024-09-23 17:31:11 -07:00
f96dae0210 client: src: lib_gen: impl overhaul for new args
- Rewrite to support new arguments
  * Related design changes and refactoring
  * Remove prompt for testing (use `dev=on` instead)
- Factor out superscript gen from subscript append
- Related print formatting changes
- Add more internal checks
2024-09-23 17:31:11 -07:00
e8509384d2 client: src: lib_gen: add args and args parsing
- Allows for a dynamic `gen` experience
  * All configs/accounts can now be (re)generated on-the-fly
    - Individually, by section, or all at once
  * Adds prompt confirmation option
  * Adds developer profile option
2024-09-23 17:31:11 -07:00
9f6ad19112 client: src: lib_gen: move hledger conf to subprofile gen
Subprofile's hledger conf should be within subprofile generation.
2024-09-22 19:35:22 -07:00
c3cf81572b client: src: refactor system checks
- UID and dependency checks are done in internal `lib_docker`/`lib_env`
- Moves `sed` check to appropriate `lib_env`
2024-09-22 19:35:22 -07:00
d8222c60fb client: src: refactor environment/gen handler
- Moves environment handling from `lib_gen` to `lib_env`
- Related refactoring
2024-09-22 19:35:22 -07:00
dc4990ab90 client: docker: complete build overhaul, optimize
This commit brings a complete overhaul of the build system:

- Creates a separation of concerns for 'local' and 'remote' building
  * 'local' is built locally via the docker-finance `build` command
  * 'remote' is built *outside* of the docker-finance `build` command
    (pushed to a remote registry and then pulled by the 'local' build)
  * Related refactoring
    - Dockerfiles
    - `lib_gen`

- Adds remote image 'hledger-suite'
  * Provides the latest versions of all `hledger` related binaries
  * No longer relies on package maintainers / out-dated packages

- Adds remote image 'docker-finance'
  * Provides base image for 'finance' and 'dev-tools' images
    - tags 'archlinux' | 'ubuntu' | 'dev-tools'

- Removes previous `hledger` related build modules
  * Removes building any `hledger` related binaries locally

- Removes 'experimental' build
  * End-user can use local custom Dockerfile and/or custom tag instead

- Updates the 'default' | 'slim' | 'tiny' | 'micro' build types
  * Refactors build type requirements into separate build modules
    - Adds 'fetch' module
    - Adds 'track' module
    - Adds 'user' module
      * creates container user *after* base and all other modules
      * allows for quick re-building across multiple local users
    - Updates 'root' module
  * `lib_docker`
    - Updates usage help
    - Adds build modules per build type

- Huge optimizations
  * Vastly improves build times
    - ~60% faster w/ a fresh build
    - ~60%-90% faster rebuild (depending on image type)
  * Vastly improves image sizes
    - e.g., 'default' Arch Linux image size is ~50% smaller
2024-09-17 20:06:33 -07:00
d4d7027f22 client: dev-tools: lib_linter: add DOCKER_FINANCE_CLIENT_PLUGINS 2024-09-07 18:46:39 -07:00
d8cc3c097f client: docker: lib_plugins: allow path depth
- Allows plugins to function within subdirectories
- Removes redundant arg checking
2024-09-04 18:17:13 -07:00
1e818b708b client: dev-tools: lib_linter: return compose down
- Don't return value of network removal
  * compose value is more appropriate
- Silence error warning
  * will complain if network is already in use
2024-08-21 20:24:43 -07:00
01ab9da53d client: lib_docker: remove platform from network name
There should be a single network amongst all docker-finance containers.
2024-08-19 22:43:57 -07:00
623c3f9e1a client: lib_docker: add tag to container name
Helps identify environment/build type during runtime.
2024-08-19 22:43:57 -07:00
bd3dec6a94 client: lib_docker: version: refactor to use yq
Replaces `shyaml` dependency with `yq`.
2024-08-17 23:19:57 -07:00
5e59087390 client: docker.bash: add Tor plugin to usage help 2024-08-15 21:31:54 -07:00
d7caec13e4 client/container: disable shellcheck warning for DOCKER_FINANCE_DEBUG
If it's not set or set to false, then it's expected to be not true.
2024-08-14 20:03:03 -07:00
5684d94d63 client: completion.bash: set xtrace if debug enabled 2024-08-14 19:40:55 -07:00