module RatDeployer::Commands::Compose

This command proxies to `docker-compose` binary, adding the following flags:

Defaults to current_env.config_files or config/default.yml and config/<current_env>.yml

It is possible to include the current_env in the prohect name by using the token `{env}`, E.g.: project_name_{env}

Public Class Methods

flags() click to toggle source
# File lib/rat_deployer/commands/compose.rb, line 35
def self.flags
  config_files =
    Config.for_env['config_files'] || %W[
      config/default.yml
      config/#{Config.env}.yml
    ]

  flags = [
    config_files.map { |cf| "-f #{cf}" },
    "-p #{Config.project_name}"
  ]

  flags.unshift(Config.remote_machine_flags) if Config.remote

  flags
end
perform(cmd, *cmd_flags, silent: false) click to toggle source
# File lib/rat_deployer/commands/compose.rb, line 22
def self.perform(cmd, *cmd_flags, silent: false)
  run(
    [
      'docker-compose',
      flags,
      cmd,
      cmd_flags
    ].flatten.join(' '),
    silent: silent
  )
    .fetch(:output)
end