class Squarectl::Task

Overview

A fully resolved unit of work for a single (target, environment) pair.

TaskFactory builds it by merging the global all environment with the selected one; the Tasks::* orchestrators then call the command-building methods mixed in from Commands::* (which ultimately shell out through the injected Executor). Holding the merged values here means the command builders never touch the raw config again.

:nodoc:

Included Modules

Defined in:

squarectl/task.cr

Constructors

Instance Method Summary

Instance methods inherited from module Squarectl::Commands::Swarm

run_docker_stack_deploy run_docker_stack_deploy, run_docker_stack_destroy run_docker_stack_destroy, run_swarm_setup_commands run_swarm_setup_commands

Instance methods inherited from module Squarectl::Commands::SSLCertificates

create_ssl_certificate(ssl_cert) create_ssl_certificate, create_ssl_certificates create_ssl_certificates, destroy_ssl_certificate(ssl_cert) destroy_ssl_certificate, destroy_ssl_certificates destroy_ssl_certificates

Instance methods inherited from module Squarectl::Commands::SetupCommands

run_docker_compose_setup_commands run_docker_compose_setup_commands

Instance methods inherited from module Squarectl::Commands::Secrets

create_docker_secret(key, file) create_docker_secret, create_docker_secrets(args) create_docker_secrets, destroy_docker_secret(key, file) destroy_docker_secret, destroy_docker_secrets(args) destroy_docker_secrets

Instance methods inherited from module Squarectl::Commands::Networks

create_docker_network(net) create_docker_network, create_docker_networks create_docker_networks, destroy_docker_network(net) destroy_docker_network, destroy_docker_networks destroy_docker_networks, docker_network_exists?(net) docker_network_exists?

Instance methods inherited from module Squarectl::Commands::Kubectl

run_kubectl_apply run_kubectl_apply, run_kubectl_setup_commands run_kubectl_setup_commands

Instance methods inherited from module Squarectl::Commands::Kompose

run_kompose(action, args) run_kompose, run_kompose_convert(config, args) run_kompose_convert

Instance methods inherited from module Squarectl::Commands::Info

print_info print_info, squarectl_environment squarectl_environment

Instance methods inherited from module Squarectl::Commands::Configs

create_docker_config(key, file) create_docker_config, create_docker_configs(args) create_docker_configs, destroy_docker_config(key, file) destroy_docker_config, destroy_docker_configs(args) destroy_docker_configs

Instance methods inherited from module Squarectl::Commands::Compose

build_docker_compose_command(action, args) build_docker_compose_command, capture_docker_compose(action, args) capture_docker_compose, exec_docker_compose(action, args) : NoReturn exec_docker_compose, extract_docker_args(args) extract_docker_args, run_docker_compose(action, args) run_docker_compose

Constructor Detail

def self.new(target : String, environment : Squarectl::Config::SquarectlEnvironment, env_vars : Hash(String, String), domains : Hash(String, String), compose_files : Array(String), compose_networks : Array(String), ssl_certificates : Array(Hash(String, String)), setup_commands : Array(Hash(String, String | Array(String))), deploy_server : String, deploy_configs : Hash(String, String), deploy_secrets : Hash(String, String), executor : Squarectl::Executor) #

[View source]
def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]

Instance Method Detail

def compose_files : Array(String) #

[View source]
def compose_files_args(prefix) #

Turns the resolved compose file list into repeated <prefix> <file> argv pairs, e.g. --file a.yml --file b.yml.


[View source]
def compose_networks : Array(String) #

[View source]
def deploy_configs : Hash(String, String) #

[View source]
def deploy_secrets : Hash(String, String) #

[View source]
def deploy_server : String #

[View source]
def domains : Hash(String, String) #

[View source]
def env_vars : Hash(String, String) #

[View source]

[View source]
def project_name #

Docker Compose/Swarm project name, e.g. myapp_staging.


[View source]
def runtime_env_vars #

SQUARECTL_* variables always injected into the child process so compose files and setup commands can reference them.


[View source]
def setup_commands : Array(Hash(String, Array(String) | String)) #

[View source]
def ssl_certificates : Array(Hash(String, String)) #

[View source]
def target : String #

[View source]
def task_env_vars #

Full environment handed to every spawned command: runtime vars overlaid with the config's env vars and the derived domain vars.


[View source]