Temporary fix for #2
This commit is contained in:
@@ -19,9 +19,9 @@ class Mrsk::Configuration
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize(config)
|
def initialize(config, validate: true)
|
||||||
@config = ActiveSupport::InheritableOptions.new(config)
|
@config = ActiveSupport::InheritableOptions.new(config)
|
||||||
ensure_required_keys_present
|
ensure_required_keys_present if validate
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,9 +3,14 @@ require "sshkit/dsl"
|
|||||||
|
|
||||||
include SSHKit::DSL
|
include SSHKit::DSL
|
||||||
|
|
||||||
MRSK_CONFIG = Mrsk::Configuration.load_file(Rails.root.join("config/deploy.yml"))
|
if (config_file = Rails.root.join("config/deploy.yml")).exist?
|
||||||
|
MRSK_CONFIG = Mrsk::Configuration.load_file(config_file)
|
||||||
|
|
||||||
SSHKit::Backend::Netssh.configure { |ssh| ssh.ssh_options = MRSK_CONFIG.ssh_options }
|
SSHKit::Backend::Netssh.configure { |ssh| ssh.ssh_options = MRSK_CONFIG.ssh_options }
|
||||||
|
|
||||||
# No need to use /usr/bin/env, just clogs up the logs
|
# No need to use /usr/bin/env, just clogs up the logs
|
||||||
SSHKit.config.command_map[:docker] = "docker"
|
SSHKit.config.command_map[:docker] = "docker"
|
||||||
|
else
|
||||||
|
# MRSK is missing config/deploy.yml – run 'rake mrsk:init'
|
||||||
|
MRSK_CONFIG = Mrsk::Configuration.new({}, validate: false)
|
||||||
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user