lib/minke/rake/app.rake in minke-1.6.1 vs lib/minke/rake/app.rake in minke-1.8.0
- old
+ new
@@ -44,11 +44,11 @@
desc "run application with Docker Compose"
task :run => ['config:set_docker_env'] do
create_dependencies
if @config.run != nil
- runner = Minke::Tasks::Run.new @config, :run, @generator_config, @docker_runner, @docker_compose_factory, @logger, @helper
+ runner = Minke::Tasks::Run.new @config, :run, @generator_config, @docker_runner, @docker_compose_factory, @service_discovery, @logger, @helper
runner.run
end
end
desc "build and run application with Docker Compose"
@@ -57,11 +57,11 @@
desc "run end to end Cucumber tests USAGE: rake app:cucumber[@tag]"
task :cucumber, [:feature] => ['config:set_docker_env'] do |t, args|
create_dependencies
if @config.cucumber != nil
- runner = Minke::Tasks::Cucumber.new @config, :cucumber, @generator_config, @docker_runner, @docker_compose_factory, @logger, @helper
+ runner = Minke::Tasks::Cucumber.new @config, :cucumber, @generator_config, @docker_runner, @docker_compose_factory, @service_discovery, @logger, @helper
runner.run
end
end
desc "push built image to Docker registry"
@@ -70,12 +70,14 @@
runner = Minke::Tasks::Push.new @config, :cucumber, @generator_config, @docker_runner, @docker_compose_factory, @logger, @helper
runner.run
end
def create_dependencies
+ @project_name = "minke#{SecureRandom.urlsafe_base64(12)}".downcase
@system_runner = Minke::Docker::SystemRunner.new
- @docker_compose_factory ||= Minke::Docker::DockerComposeFactory.new @system_runner
+ @docker_compose_factory ||= Minke::Docker::DockerComposeFactory.new @system_runner, @project_name
@docker_runner ||= Minke::Docker::DockerRunner.new
+ @service_discovery ||= Minke::Docker::ServiceDiscovery.new @project_name, @docker_runner
if @config == nil
reader = Minke::Config::Reader.new
@config = reader.read './config.yml'
end