module Squarectl
Overview
Top-level namespace and configuration holder.
The parsed configuration is kept in class-level state (@@config,
@@environments, @@environment_all) so that any component can reach it via
Squarectl.config without threading it through. Because this state is global,
specs must call .reset_config! between examples (see spec/spec_helper.cr).
Defined in:
squarectl.crsquarectl/cli.cr
squarectl/cli/completion.cr
squarectl/cli/compose.cr
squarectl/cli/configs.cr
squarectl/cli/info.cr
squarectl/cli/kube.cr
squarectl/cli/secrets.cr
squarectl/cli/swarm.cr
squarectl/commands/compose.cr
squarectl/commands/configs.cr
squarectl/commands/info.cr
squarectl/commands/kompose.cr
squarectl/commands/kubectl.cr
squarectl/commands/networks.cr
squarectl/commands/secrets.cr
squarectl/commands/setup_commands.cr
squarectl/commands/ssl_certificates.cr
squarectl/commands/swarm.cr
squarectl/config/compose_file.cr
squarectl/config/domain.cr
squarectl/config/env_var.cr
squarectl/config/network.cr
squarectl/config/server.cr
squarectl/config/setup_command.cr
squarectl/config/squarectl_config.cr
squarectl/config/squarectl_environment.cr
squarectl/config/ssl_certificate.cr
squarectl/config/ssl_certificate_spec.cr
squarectl/executor.cr
squarectl/shell_completion.cr
squarectl/task.cr
squarectl/task_factory.cr
squarectl/tasks/compose.cr
squarectl/tasks/configs.cr
squarectl/tasks/info.cr
squarectl/tasks/kube.cr
squarectl/tasks/secrets.cr
squarectl/tasks/swarm.cr
Constant Summary
-
GIT_REF =
{{ (`git log -n 1 --format=\"%H\" | head -c 8`).chomp.stringify }} -
VERSION =
{{ (`shards version /srv/crystaldoc.info/github-jbox-web-squarectl-v1.6.3/src`).chomp.stringify }}
Class Method Summary
- .app_name
-
.compose_v1?
Whether the config requests Compose v1 (
docker-compose) instead of v2 (docker compose). - .config
-
.data_dir
Project directory conventions, all relative to the current working directory: root_dir/ # the project (cwd) root_dir/kubernetes/
/ # generated Kubernetes manifests root_dir/squarectl/ # data_dir: base.yml lives here root_dir/squarectl/targets/ # per-target compose files ( /common.yml, / .yml) root_dir/squarectl/targets/common/ # extra compose files referenced by config -
.env_vars_to_hash
Snapshot of the process environment as a plain hash, injected into the Crinja template context.
-
.environment_all
The special
allenvironment holding global defaults thatTaskFactorymerges into every other environment. - .environments
- .executor
- .executor=(executor : Executor)
-
.find_environment(environment, target)
Resolves the environment selected on the command line for the given target.
-
.kubernetes_dir
Project directory conventions, all relative to the current working directory: root_dir/ # the project (cwd) root_dir/kubernetes/
/ # generated Kubernetes manifests root_dir/squarectl/ # data_dir: base.yml lives here root_dir/squarectl/targets/ # per-target compose files ( /common.yml, / .yml) root_dir/squarectl/targets/common/ # extra compose files referenced by config -
.load_config(config_path)
Reads the config file, renders it as a Crinja (Jinja) template with the current process environment exposed as
ENV, then parses the result as YAML. -
.reset_config!
Clears the cached config so a fresh one can be loaded.
-
.root_dir
Project directory conventions, all relative to the current working directory: root_dir/ # the project (cwd) root_dir/kubernetes/
/ # generated Kubernetes manifests root_dir/squarectl/ # data_dir: base.yml lives here root_dir/squarectl/targets/ # per-target compose files ( /common.yml, / .yml) root_dir/squarectl/targets/common/ # extra compose files referenced by config -
.targets_common_dir
Project directory conventions, all relative to the current working directory: root_dir/ # the project (cwd) root_dir/kubernetes/
/ # generated Kubernetes manifests root_dir/squarectl/ # data_dir: base.yml lives here root_dir/squarectl/targets/ # per-target compose files ( /common.yml, / .yml) root_dir/squarectl/targets/common/ # extra compose files referenced by config -
.targets_dir
Project directory conventions, all relative to the current working directory: root_dir/ # the project (cwd) root_dir/kubernetes/
/ # generated Kubernetes manifests root_dir/squarectl/ # data_dir: base.yml lives here root_dir/squarectl/targets/ # per-target compose files ( /common.yml, / .yml) root_dir/squarectl/targets/common/ # extra compose files referenced by config -
.version
Human-readable version string, e.g.
Class Method Detail
Whether the config requests Compose v1 (docker-compose) instead of v2
(docker compose). Drives the command prefix in Commands::Compose.
Project directory conventions, all relative to the current working directory:
root_dir/ # the project (cwd)
root_dir/kubernetes/
Snapshot of the process environment as a plain hash, injected into the Crinja template context.
The special all environment holding global defaults that TaskFactory
merges into every other environment. Returns nil when not defined.
The Executor the CLI hands to every built Task. Memoized to a real
Executor by default; specs override it (Squarectl.executor = mock) to
capture the commands each subcommand dispatches without shelling out.
Resolves the environment selected on the command line for the given target.
An exact name match wins; otherwise the name is treated as a substring
(prod matches production) but an ambiguous substring matching more than
one environment is rejected rather than silently picking the first. Raises on
an unknown target/environment, and forbids any non-compose target on the
development environment.
Project directory conventions, all relative to the current working directory:
root_dir/ # the project (cwd)
root_dir/kubernetes/
Reads the config file, renders it as a Crinja (Jinja) template with the
current process environment exposed as ENV, then parses the result as YAML.
This is why {{ ENV.FOO }} works inside squarectl.yml.
Clears the cached config so a fresh one can be loaded. Used by the test suite.
Project directory conventions, all relative to the current working directory:
root_dir/ # the project (cwd)
root_dir/kubernetes/
Project directory conventions, all relative to the current working directory:
root_dir/ # the project (cwd)
root_dir/kubernetes/
Project directory conventions, all relative to the current working directory:
root_dir/ # the project (cwd)
root_dir/kubernetes/