From 626f40b0fa291b26fa5ef4c7936fdff39dde590b Mon Sep 17 00:00:00 2001 From: Karl Matthias Date: Fri, 8 May 2015 20:57:22 -0700 Subject: [PATCH] Need to actually create the service properly. --- lib/centurion/deploy_dsl.rb | 9 ++++++++- spec/service_spec.rb | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/centurion/deploy_dsl.rb b/lib/centurion/deploy_dsl.rb index 7cf40077..d9118039 100644 --- a/lib/centurion/deploy_dsl.rb +++ b/lib/centurion/deploy_dsl.rb @@ -95,7 +95,14 @@ def defined_restart_policy private def service_under_construction - service = fetch(:service, Centurion::Service.new(fetch(:project))) + service = fetch(:service, + Centurion::Service.from_hash( + fetch(:project), + image: fetch(:image), + hostname: fetch(:container_hostname), + dns: fetch(:custom_dns) + ) + ) set(:service, service) end diff --git a/spec/service_spec.rb b/spec/service_spec.rb index 90ca66ce..7be61187 100644 --- a/spec/service_spec.rb +++ b/spec/service_spec.rb @@ -16,7 +16,8 @@ port_bindings: [ { host_port: 12340, container_port: 80, type: 'tcp' } ] ) - expect(svc.name). to eq('mycontainer') + expect(svc.name).to eq('mycontainer') + expect(svc.image).to eq(image) expect(svc.hostname).to eq(hostname) expect(svc.dns).to be_nil expect(svc.volumes.size).to eq(1)