Module: RatDeployer::Commands::Compose
- Extended by:
- RatDeployer::Command
- Defined in:
- lib/rat_deployer/commands/compose.rb
Overview
This command proxies to docker-compose binary, adding the following flags:
-
-f for each config file.
Defaults to current_env.config_files or config/default.yml and config/<current_env>.yml
-
-p with the configured project_name
It is possible to include the current_env in the prohect name by using the token ‘env`, E.g.: project_name_env
Defined Under Namespace
Modules: Extension
Class Method Summary collapse
Methods included from RatDeployer::Command
colorize_warning, do_run, put_error, put_heading, put_warning, run
Class Method Details
.flags ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# 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) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 |
# 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 |