Module: Orchestration

Defined in:
lib/orchestration.rb,
lib/orchestration/errors.rb,
lib/orchestration/railtie.rb,
lib/orchestration/version.rb,
lib/orchestration/services.rb,
lib/orchestration/settings.rb,
lib/orchestration/terminal.rb,
lib/orchestration/environment.rb,
lib/orchestration/file_helpers.rb,
lib/orchestration/services/app.rb,
lib/orchestration/service_check.rb,
lib/orchestration/docker_compose.rb,
lib/orchestration/services/mongo.rb,
lib/orchestration/services/redis.rb,
lib/orchestration/install_generator.rb,
lib/orchestration/services/database.rb,
lib/orchestration/services/listener.rb,
lib/orchestration/services/rabbitmq.rb,
lib/orchestration/docker_healthcheck.rb,
lib/orchestration/services/app/healthcheck.rb,
lib/orchestration/docker_compose/app_service.rb,
lib/orchestration/services/app/configuration.rb,
lib/orchestration/services/database/adapters.rb,
lib/orchestration/services/mongo/healthcheck.rb,
lib/orchestration/services/redis/healthcheck.rb,
lib/orchestration/docker_compose/configuration.rb,
lib/orchestration/docker_compose/mongo_service.rb,
lib/orchestration/docker_compose/redis_service.rb,
lib/orchestration/services/mongo/configuration.rb,
lib/orchestration/services/redis/configuration.rb,
lib/orchestration/services/database/healthcheck.rb,
lib/orchestration/services/listener/healthcheck.rb,
lib/orchestration/services/rabbitmq/healthcheck.rb,
lib/orchestration/docker_compose/compose_helpers.rb,
lib/orchestration/docker_compose/database_service.rb,
lib/orchestration/docker_compose/rabbitmq_service.rb,
lib/orchestration/services/database/configuration.rb,
lib/orchestration/services/listener/configuration.rb,
lib/orchestration/services/rabbitmq/configuration.rb,
lib/orchestration/docker_compose/install_generator.rb,
lib/orchestration/services/mixins/healthcheck_base.rb,
lib/orchestration/services/mixins/http_healthcheck.rb,
lib/orchestration/services/database/adapters/mysql2.rb,
lib/orchestration/services/database/adapters/postgis.rb,
lib/orchestration/services/database/adapters/sqlite3.rb,
lib/orchestration/services/mixins/configuration_base.rb,
lib/orchestration/docker_compose/compose_configuration.rb,
lib/orchestration/services/database/adapters/postgresql.rb,
lib/orchestration/services/database/adapters/adapter_base.rb

Defined Under Namespace

Modules: DockerCompose, FileHelpers, Services Classes: DatabaseConfigurationError, DockerHealthcheck, Environment, HTTPConnectionError, InstallGenerator, MongoConfigurationError, OrchestrationError, Railtie, ServiceCheck, Settings, Terminal, UnknownEnvironmentError

Constant Summary collapse

VERSION =
'0.7.13'
COLOR_MAP =
{
  failure: %i[red bright],
  success: %i[green],
  info: %i[blue],
  error: %i[red],
  ready: %i[green],
  create: %i[green],
  delete: %i[red],
  rename: %i[blue],
  update: %i[yellow],
  backup: %i[blue],
  status: %i[blue],
  setup: %i[blue],
  input: %i[red],
  skip: %i[yellow bright],
  waiting: %i[yellow],
  config: %i[cyan]
}.freeze

Class Method Summary collapse

Class Method Details

.error(key, options = {}) ⇒ Object



49
50
51
52
# File 'lib/orchestration.rb', line 49

def error(key, options = {})
  warn('# Orchestration Error')
  warn("# #{I18n.t("orchestration.#{key}", options)}")
end

.makefileObject



41
42
43
# File 'lib/orchestration.rb', line 41

def makefile
  root.join('lib', 'orchestration', 'make', 'orchestration.mk')
end


62
63
64
65
66
67
68
69
70
71
72
# File 'lib/orchestration.rb', line 62

def print_environment
  return unless File.exist?('.env')

  $stderr.puts
  warn("#{prefix} #{Paint['Loading environment from', :cyan]} #{Paint['.env', :green]}")
  $stderr.puts
  environment_variables.each do |variable, value|
    terminal.print_variable(variable, value)
  end
  $stderr.puts
end

.rakefileObject



45
46
47
# File 'lib/orchestration.rb', line 45

def rakefile
  root.join('lib', 'Rakefile')
end

.random_local_portObject



54
55
56
57
58
59
60
# File 'lib/orchestration.rb', line 54

def random_local_port
  socket = Socket.new(:INET, :STREAM, 0)
  socket.bind(Addrinfo.tcp('127.0.0.1', 0))
  port = socket.local_address.ip_port
  socket.close
  port
end

.rootObject



37
38
39
# File 'lib/orchestration.rb', line 37

def root
  Pathname.new(File.dirname(__dir__))
end