lib/minke/tasks/task.rb in minke-1.14.1 vs lib/minke/tasks/task.rb in minke-1.14.2

- old
+ new

@@ -61,11 +61,11 @@ abort unless success end ## # runs the given command in a docker container - def run_command_in_container command, blocking = false + def run_command_in_container(command, blocking = false, links = nil, ports = nil) begin @logger.info "Running command: #{command}" settings = @generator_config.build_settings.docker_settings volumes = settings.binds.clone unless settings.binds == nil environment = settings.env.clone unless settings.env == nil @@ -76,15 +76,22 @@ volumes.push "#{ENV['AGENT_SOCK']}:/ssh-agent" environment.push "SSH_AUTH_SOCK=/ssh-agent" environment.push "GIT_SSH_COMMAND=ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" end + if @task_settings.consul_loader != nil && links != nil + links.push "consul" + end + + args = { :image => build_image, :command => command, :volumes => volumes, :environment => environment, - :working_directory => working_directory + :working_directory => working_directory, + :links => links, + :ports => ports, } if blocking == false container, success = @docker_runner.create_and_run_container args else