diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9119b8f2..0b668452 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-06-07 07:43:43 UTC using RuboCop version 1.50.2. +# on 2024-06-27 01:53:02 UTC using RuboCop version 1.50.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -37,7 +37,7 @@ Lint/ConstantDefinitionInBlock: # Offense count: 13 # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes. Metrics/AbcSize: - Max: 58 + Max: 64 # Offense count: 1 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. @@ -48,7 +48,7 @@ Metrics/BlockLength: # Offense count: 1 # Configuration parameters: CountComments, CountAsOne. Metrics/ClassLength: - Max: 477 + Max: 485 # Offense count: 1 # Configuration parameters: AllowedMethods, AllowedPatterns. @@ -58,7 +58,7 @@ Metrics/CyclomaticComplexity: # Offense count: 17 # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. Metrics/MethodLength: - Max: 45 + Max: 51 # Offense count: 1 # Configuration parameters: CountKeywordArgs, MaxOptionalParameters. diff --git a/lib/kaiser/cli.rb b/lib/kaiser/cli.rb index da76b585..2082a54f 100644 --- a/lib/kaiser/cli.rb +++ b/lib/kaiser/cli.rb @@ -252,7 +252,7 @@ def attach_app attach_mounts = Config.kaiserfile.attach_mounts volumes = attach_mounts.map { |from, to| "-v #{`pwd`.chomp}/#{from}:#{to}" }.join(' ') - system "docker run -ti + cmd = "docker run -ti --name #{app_container_name} --network #{network_name} --dns #{ip_of_container(Config.config[:shared_names][:dns])} @@ -265,6 +265,9 @@ def attach_app #{app_params} kaiser:#{envname}-#{current_branch} #{cmd}".tr("\n", ' ') + puts cmd + system cmd + stop_services Config.out.puts 'Cleaning up...' @@ -555,15 +558,6 @@ def ensure_setup --network #{Config.config[:networkname]} redis:7-alpine" ) - run_if_dead( - Config.config[:shared_names][:chrome], - "docker run -d - -p 5900:5900 - --shm-size='2g' - --name #{Config.config[:shared_names][:chrome]} - --network #{Config.config[:networkname]} - #{selenium_node_image}" - ) run_if_dead( Config.config[:shared_names][:nginx], "docker run -d @@ -576,17 +570,35 @@ def ensure_setup --network #{Config.config[:networkname]} jwilder/nginx-proxy" ) + + dnsconffile = "#{ENV['HOME']}/.kaiser/dnsconf" + File.write(dnsconffile, <<~HOSTS) + log-queries + no-resolv + server=8.8.8.8 + server=1.1.1.1 + address=/.#{http_suffix}/#{ip_of_container(Config.config[:shared_names][:nginx])} + HOSTS + run_if_dead( Config.config[:shared_names][:dns], "docker run -d --name #{Config.config[:shared_names][:dns]} --network #{Config.config[:networkname]} - --privileged - -e DOCKER_HOST='unix:///var/run/docker.sock' - -v /var/run/docker.sock:/var/run/docker.sock:ro - davidsiaw/dockerdns - --domain #{http_suffix} - --record :#{ip_of_container(Config.config[:shared_names][:nginx])}" + -v #{dnsconffile}:/etc/dnsmasq.conf:ro + degica/dnsmasq + " + ) + + run_if_dead( + Config.config[:shared_names][:chrome], + "docker run -d + -p 5900:5900 + --shm-size='2g' + --name #{Config.config[:shared_names][:chrome]} + --network #{Config.config[:networkname]} + --dns #{ip_of_container(Config.config[:shared_names][:dns])} + #{selenium_node_image}" ) end diff --git a/lib/kaiser/version.rb b/lib/kaiser/version.rb index b54b1bd1..04522745 100644 --- a/lib/kaiser/version.rb +++ b/lib/kaiser/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Kaiser - VERSION = '0.8.2' + VERSION = '0.8.3' end