More sessions

This commit is contained in:
2026-02-24 18:03:22 +00:00
parent eb5bd4a929
commit 23cc78aa98
284 changed files with 129543 additions and 4 deletions

View File

@@ -0,0 +1,34 @@
module Dalmatian
class Infrastructure
def initialize(configuration = ConfigurationReader.new.infrastructures)
@clusters = configuration.map { |description| Cluster.new(description) }
end
BOOTSTRAP_PATH = "terraform/account_bootstrap".freeze
PATH = "terraform/infrastructures".freeze
APP_ROOT = File.expand_path(File.dirname("."))
def fetch(infrastructure_name: "all")
clusters.each do |cluster|
cluster.fetch(infrastructure_name: infrastructure_name)
end
end
def test(environment_name: "all", infrastructure_name: "all", service_name: "all", skip_deployments: "")
deploy(environment_name: environment_name, infrastructure_name: infrastructure_name, service_name: service_name, skip_deployments: skip_deployments, test: true, auto_approve: false, plan: true, destroy: false)
end
def deploy(environment_name: "all", infrastructure_name: "all", service_name: "all", skip_deployments: "", test: false, auto_approve: false, plan: false, destroy: false, verbose: false)
clusters.each do |cluster|
next if cluster.id != infrastructure_name && infrastructure_name != "all"
cluster.deploy(environment_name: environment_name, service_name: service_name, skip_deployments: skip_deployments, test: test, auto_approve: auto_approve, plan: plan, destroy: destroy, verbose: verbose)
end
end
def remove(environment_name: "all", infrastructure_name: "all", service_name: "all", skip_deployments: "")
deploy(environment_name: environment_name, infrastructure_name: infrastructure_name, service_name: service_name, skip_deployments: skip_deployments, test: false, auto_approve: false, plan: false, destroy: true)
end
attr_reader :clusters
end
end