minke 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- N2VlY2ZlYTMyYTU5NDIyYWEwODQwYzk2MDk2ZDJmNWFlMjE2MTcxOQ==
4
+ NDY2MjFhZTEwZjI5OGY0MGFjZDVkYjVkMmViYWI5NDIzNDBhOTdiYg==
5
5
  data.tar.gz: !binary |-
6
- NzZlMjRkZjFhNTQ0YTI1Y2ZjM2RiMWQzZDQ5YTQ1NDJiYjczOWY0OA==
6
+ YzIyM2IwMGIwNGMyNDU3MjE3Njg1YjAzZDk0YWY2NzFhM2IxZTU2Zg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NGU0ODFmMTI5OTVhZmQ3YjhiOTliMzM4ZTY1NTU0MWU5NDZlN2E1MjFiNWRk
10
- MWY5NTk5ZDY0NTMzMTFlZTc5ZjJlMGE1ZWFmODM5ZmMxZGQzY2QwMWE5Mjg5
11
- ZjE4YzZiZjA0YjM0ZTA3NTJkYzkwOGE1NDQ1MmRmYjg1NmM2NGI=
9
+ MGM4M2UyMzZmZmMyYzhhZTFmZWVhMDZiZDMyNDE1NDE1ODBhYzFjNjIxMWE5
10
+ MjJiZWQzODFjMTFhYWNkMTc1MDU0NzBiYjM5OGI1YjU1ZWM2Y2M3ZDE2MmMx
11
+ YTEyY2I0NWMzNTI5ZmU3ZDc5NjI3MDBmMDkyMmJmYmMwNmFkZTY=
12
12
  data.tar.gz: !binary |-
13
- MmU4ZDA1ZWQzODRlNzY2ZGI5MGEyZmY2NzA3ZjFjZTIxNzc5NmM1Mjc3Mjkz
14
- NGVkMTE2YWYxZmU4M2Y1ZjEzYjk4OGUwZWRjN2M1YjM2YzI3Mjc3ZTdmOTM3
15
- MmUxOTExOGFhNzU3ZDI5ZjJiZWQ2MjczOGQ2Njg5MTA3NjQxODc=
13
+ MThmMTExOGM4NzIzMzc2OGFhODZiZTliNDMxYTJjMGZiYTQ3YzdmMDAyZWE2
14
+ ZjZlMTkzZDA3YWE3NWJiOTJiN2Y0NzU5ZDNkMjhiYzcxYTAzNGQxODBkMDE0
15
+ YzM4N2RkMTBkZDJkNjdmZTA1NDhmYjdmNGQ3OWZiYTVhMzRiNjY=
@@ -4,18 +4,16 @@ module Minke
4
4
  ##
5
5
  # returns the ip address that docker is running on
6
6
  def get_docker_ip_address
7
- if ENV['DOCKER_IP'] == nil
8
- if ENV['DOCKER_HOST']
9
- # dockerhost set
10
- host = ENV['DOCKER_HOST'].dup
11
- host.gsub!(/tcp:\/\//, '')
12
- host.gsub!(/:\d+/,'')
13
-
14
- return host
15
- else
16
- return '127.0.0.1'
17
- end
18
- end
7
+ if ENV['DOCKER_HOST']
8
+ # dockerhost set
9
+ host = ENV['DOCKER_HOST'].dup
10
+ host.gsub!(/tcp:\/\//, '')
11
+ host.gsub!(/:\d+/,'')
12
+
13
+ return host
14
+ else
15
+ return '127.0.0.1'
16
+ end
19
17
  end
20
18
 
21
19
  ##
@@ -1,7 +1,7 @@
1
1
  namespace :app do
2
2
 
3
3
  desc "fetch dependent packages"
4
- task :fetch => ['config:set_docker_env', 'docker:fetch_images'] do
4
+ task :fetch => ['config:set_docker_env'] do
5
5
  create_dependencies
6
6
 
7
7
  if @config.fetch != nil
@@ -70,6 +70,8 @@ module Minke
70
70
  if @build_file != nil
71
71
  @build_image = "#{@config.application_name}-buildimage"
72
72
  @docker_runner.build_image @build_file, @build_image
73
+ else
74
+ @docker_runner.pull_image @build_image unless @docker_runner.find_image @build_image
73
75
  end
74
76
 
75
77
  container, success = @docker_runner.create_and_run_container @build_image, settings.binds, settings.env, settings.working_directory, command
@@ -85,7 +87,14 @@ module Minke
85
87
  if url.type == 'public'
86
88
  "#{url.protocol}://#{url.address}:#{url.port}#{url.path}"
87
89
  else
90
+ # if running on docker for mac we need to replace the ip address with the docker hosts
88
91
  public_address = @compose.public_address url.address, url.port
92
+
93
+ ip = @docker_runner.get_docker_ip_address
94
+ if ip != "127.0.0.1" && ip != "0.0.0.0" && ip != nil
95
+ public_address.gsub!('0.0.0.0', ip)
96
+ end
97
+
89
98
  "#{url.protocol}://#{public_address}#{url.path}"
90
99
  end
91
100
  end
data/lib/minke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Minke
2
- VERSION = "1.0.2"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minke
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Jackson