minke 1.8.0 → 1.8.1

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
- YmRhZmY1MDljOWIyNjkxOWU0Y2NhYTg5MTdmZjI5ZGFjNDdjYWM5Yg==
4
+ MzMzMTRjZjYyYjg4NjViMzQzNWQ0NjNiMWRiMjhkNzlhMjQ5MTYxMg==
5
5
  data.tar.gz: !binary |-
6
- ODVkMWRmODEzYWZhZmYwY2FlODFiMTY2MTIzYzNmMjI4OTI5M2M1ZQ==
6
+ ODFlM2Q5ZTNiYWU3NWQwMTJiNWM5NTgxOWI3YWVkNjVkZjE2YzcxMg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzBiNmE2YjA3ZDRhMjY1NjYzM2M4MzJkYmI4NjZlZTNjZDBlODZlMTNiMTEw
10
- ZTQyNmMxYmJjNzhiODFkNzhmZTBmNTBlMjQwNjQyNGMwYzNlNDJhNDM5ODE2
11
- ZmYzMDZhYTM0NzBhMGQ4NmU0NGE0NDIxZjg2OWJlMDg1OTE5ZGY=
9
+ NWEzYmRlZjE1Y2Q4MWQ4NDNmYWUxYzZhY2I3MjM2NDVhNWE3ODE2ZjMzNzFh
10
+ NGJmNGRiMDcxY2FkOTg3MmYwNDhlOGZiMDE3MjU2MTgxOWU0NTEzNTdlMmFl
11
+ MzE5ODFkOTVjZjQ5MzNkZjA5ZWE2ZjU4N2NmOTY3Zjk4ZTU0OGI=
12
12
  data.tar.gz: !binary |-
13
- M2UyMWYwMzNiYzI2NzFhMjQ5ZjVjYTgxNzFjNWI1Y2E4ZTE0MDMwMTFkNzQw
14
- ZjZlYmM1ZjU0MTU2NzcwYThkZmFlYjA4MjI0YzJjOTM4NjJkYWE0NzFiZTc1
15
- MGVjYmM2OGE3MTY1MjVkMWY5MmY1ZjhkNmViMTQyZmFkNzVlZTI=
13
+ MjcyYTY2NjJlMTY4ZDRjNTMwZmU2NTdlODdhZDgyYzkxOTViYzExYmU4MDY1
14
+ OWZjY2JhZjZlY2M5MDM5ZmM0YjVmMWQ2NWZiOWFmM2ZlMDFlNTFiNjNjYzBk
15
+ NDk1ZWVmZGRlYTY1MGQ1NmUzZTNiZWY3OGQyMjFjN2E3MTM0MDM=
data/docker/Dockerfile CHANGED
@@ -1,4 +1,13 @@
1
1
  FROM ruby:latest
2
2
 
3
+ ENV COMPOSE_VERSION 1.7.1
4
+ ENV MACHINE_VERSION 0.7.0
5
+
6
+ RUN apt-get update -q \
7
+ && apt-get install -y -q --no-install-recommends curl ca-certificates \
8
+ && curl -o /usr/local/bin/docker-compose -L \
9
+ "https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-Linux-x86_64" \
10
+ && chmod +x /usr/local/bin/docker-compose
11
+
3
12
  COPY ./Gemfile Gemfile
4
13
  RUN bundle install
@@ -32,15 +32,15 @@ module Minke
32
32
  # Will attempt to locate the private details for a running container given
33
33
  # its name and private port
34
34
  # Parameters:
35
+ # - network: the name of the network the container is running on
35
36
  # - service_name: the name of the running service
36
37
  # - private_port: the private port which you wish to retrieve an address for
37
38
  # Returns:
38
39
  # private address for the container e.g. 172.17.0.2:8080
39
- def bridge_address_for service_name, private_port
40
+ def bridge_address_for network, service_name, private_port
40
41
  begin
41
- puts "/#{@project_name}_#{service_name}_1"
42
42
  container_details = find_container_by_name "/#{@project_name}_#{service_name}_1"
43
- ip = container_details.first.info['NetworkSettings']['Networks']['bridge']['IPAddress']
43
+ ip = container_details.first.info['NetworkSettings']['Networks']["#{network}"]['IPAddress']
44
44
  rescue
45
45
  raise "Unable to find bridge address for '#{service_name}' on port #{private_port}"
46
46
  end
@@ -72,7 +72,7 @@ namespace :app do
72
72
  end
73
73
 
74
74
  def create_dependencies
75
- @project_name = "minke#{SecureRandom.urlsafe_base64(12)}".downcase
75
+ @project_name = "minke#{SecureRandom.urlsafe_base64(12)}".downcase.gsub('-', '')
76
76
  @system_runner = Minke::Docker::SystemRunner.new
77
77
  @docker_compose_factory ||= Minke::Docker::DockerComposeFactory.new @system_runner, @project_name
78
78
  @docker_runner ||= Minke::Docker::DockerRunner.new
@@ -88,7 +88,7 @@ module Minke
88
88
  if url.type == 'external'
89
89
  "#{url.protocol}://#{url.address}:#{url.port}#{url.path}"
90
90
  elsif url.type == 'bridge'
91
- address = @service_discovery.bridge_address_for url.address, url.port
91
+ address = @service_discovery.bridge_address_for ENV['DOCKER_NETWORK'], url.address, url.port
92
92
  "#{url.protocol}://#{address}#{url.path}"
93
93
  elsif url.type == 'public'
94
94
  address = @service_discovery.public_address_for url.address, url.port
data/lib/minke/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Minke
2
- VERSION = "1.8.0"
2
+ VERSION = "1.8.1"
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.8.0
4
+ version: 1.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nic Jackson