diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index bd8d9fee..fcb835f9 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -14,6 +14,8 @@ Your name could be here! * [Mark Borcherding][markborcherding] * [Nick Laferriere][laferrieren] * [Hugo Chinchilla][hugochinchilla] + * [Dan Selans][dselans] + * [Dan Young][idleyoungman] Pre-release ----------- diff --git a/lib/centurion/docker_server.rb b/lib/centurion/docker_server.rb index 640931eb..05cb36a7 100644 --- a/lib/centurion/docker_server.rb +++ b/lib/centurion/docker_server.rb @@ -21,7 +21,11 @@ class Centurion::DockerServer def initialize(host, docker_path, tls_params = {}) @docker_path = docker_path @hostname, @port = host.split(':') - @port ||= '2375' + @port ||= if tls_params.empty? + '2375' + else + '2376' + end @tls_params = tls_params end diff --git a/lib/centurion/docker_via_api.rb b/lib/centurion/docker_via_api.rb index 312bc691..e08f74ba 100644 --- a/lib/centurion/docker_via_api.rb +++ b/lib/centurion/docker_via_api.rb @@ -152,6 +152,7 @@ def configure_excon_globally Excon.defaults[:nonblock] = false Excon.defaults[:tcp_nodelay] = true Excon.defaults[:ssl_ca_file] = @tls_args[:tlscacert] + Excon.defaults[:ssl_verify_peer] = false end def default_tls_args(tls_enabled) diff --git a/lib/centurion/docker_via_cli.rb b/lib/centurion/docker_via_cli.rb index f0cb6695..6a286736 100644 --- a/lib/centurion/docker_via_cli.rb +++ b/lib/centurion/docker_via_cli.rb @@ -68,7 +68,7 @@ def tls_parameters def build_command(action, destination) command = "#{@docker_path} -H=#{@docker_host}" - command << tls_parameters + command << tls_parameters || '' command << case action when :pull then ' pull ' when :logs then ' logs -f ' diff --git a/lib/tasks/deploy.rake b/lib/tasks/deploy.rake index e0f11e68..3598dae8 100644 --- a/lib/tasks/deploy.rake +++ b/lib/tasks/deploy.rake @@ -31,6 +31,7 @@ end task :stop => ['deploy:stop'] task :enter_container => ['deploy:enter_container'] +task :logs => ['deploy:logs'] namespace :dev do task :export_only do @@ -125,6 +126,13 @@ namespace :deploy do end end + task :logs do + Centurion::DockerServerGroup.new(fetch(:hosts, []), fetch(:docker_path)).each_in_parallel do |host| + container_id = host.ps.select { |c| c['Names'].select { |n| n =~ /#{fetch(:name)}/ } }.first['Id'] + host.tail(container_id) + end + end + task :rolling_deploy do on_each_docker_host do |server| service = defined_service