et_full_system 0.1.76 → 0.1.77

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2ebe2ee5cba408f767ad14b6c77bb605b04574d233c646148b1861ff042b663
4
- data.tar.gz: 83e7d4e2440ae59ae99ad02a3e499075ac3f68abd2fa2c0654482b78aebf3758
3
+ metadata.gz: a16e0ca10760de7de9c31a7879781c69d59627c823bf37971e1637e768480af7
4
+ data.tar.gz: e1efc5bd2df19588c97e0859942356bb6c39f201323dfc9406b3d02c76fd59e8
5
5
  SHA512:
6
- metadata.gz: b141d9e5bdbd686e334804956ad1ce088371e51bbf98191b62a2e338cc59cbd938d0479bec51c128c491a77d4653cedafb3f103b1d09c74240c3a1dbc94e06bd
7
- data.tar.gz: 9154e9eb6703cfbdfad6f943f6f6954a1f4188ae2f0ba731a1fd5fc051732c94ebfa47a1875a424e5cbb5297196c346906aaa55cb8d71bf0c8c4eb4e58f17697
6
+ metadata.gz: 3773ee1b5b09508bd30d94005d2bea58c425afab787aa7a156142f956e3f7da2eb8faa1fd81f79e2110a7552caf86f1c1a851f6ec9379ad3df2abbc49bb41dbc
7
+ data.tar.gz: 6191244bbdfca12aec71d26ccf182a476dde4ae83bc5d70a98c992e9612c802f06dc35062234819980014459ceb6570dfad7a3598e916906ba241833d703e96a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- et_full_system (0.1.76)
4
+ et_full_system (0.1.77)
5
5
  aws-sdk-s3 (~> 1.9)
6
6
  azure-storage (~> 0.15.0.preview)
7
7
  dotenv (~> 2.7, >= 2.7.2)
@@ -23,7 +23,7 @@ GEM
23
23
  addressable (2.7.0)
24
24
  public_suffix (>= 2.0.2, < 5.0)
25
25
  aws-eventstream (1.0.3)
26
- aws-partitions (1.214.0)
26
+ aws-partitions (1.218.0)
27
27
  aws-sdk-core (3.68.0)
28
28
  aws-eventstream (~> 1.0, >= 1.0.2)
29
29
  aws-partitions (~> 1.0)
@@ -79,7 +79,7 @@ GEM
79
79
  mime-types-data (~> 3.2015)
80
80
  mime-types-data (3.2019.0904)
81
81
  mini_portile2 (2.4.0)
82
- minitest (5.11.3)
82
+ minitest (5.12.0)
83
83
  multi_json (1.13.1)
84
84
  multi_xml (0.6.0)
85
85
  multipart-post (2.1.1)
@@ -111,7 +111,7 @@ GEM
111
111
  tilt (~> 2.0)
112
112
  thor (0.20.3)
113
113
  thread_safe (0.3.6)
114
- tilt (2.0.9)
114
+ tilt (2.0.10)
115
115
  tzinfo (1.2.5)
116
116
  thread_safe (~> 0.1)
117
117
 
@@ -1,4 +1,5 @@
1
1
  require_relative './docker/server'
2
+ require 'json'
2
3
  module EtFullSystem
3
4
  #!/usr/bin/env ruby
4
5
  # frozen_string_literal: true
@@ -61,6 +62,11 @@ module EtFullSystem
61
62
  end
62
63
  end
63
64
 
65
+ desc "local_service SERVICE PORT", "Configures the reverse proxy to connect to a specific port on the host machine - the URL is calculated - otherwise it is the same as update_service_url"
66
+ def local_service(service, port)
67
+ update_service_url(service, local_service_url(port))
68
+ end
69
+
64
70
  desc "service_env SERVICE", "Returns the environment variables configured for the specified service"
65
71
  def service_env(service)
66
72
  Bundler.with_original_env do
@@ -71,5 +77,24 @@ module EtFullSystem
71
77
  exec(compose_cmd)
72
78
  end
73
79
  end
80
+
81
+ private
82
+
83
+ def host_ip
84
+ JSON.parse `docker network inspect \`docker network list | grep docker_et_full_system | awk '{print $1}'\``
85
+ end
86
+
87
+ def local_service_url(port)
88
+ case ::EtFullSystem.os
89
+ when :linux, :unix
90
+ "http://#{host_ip}:#{port}"
91
+ when :osx
92
+ "http://docker.for.mac.localhost"
93
+ when :windows
94
+ "http://docker.for.windows.localhost"
95
+ else
96
+ raise "Unknown host type - this tool only supports mac, linux and windows"
97
+ end
98
+ end
74
99
  end
75
100
  end
@@ -0,0 +1,21 @@
1
+ require 'rbconfig'
2
+
3
+ module EtFullSystem
4
+ def self.os
5
+ @os ||= (
6
+ host_os = RbConfig::CONFIG['host_os']
7
+ case host_os
8
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
9
+ :windows
10
+ when /darwin|mac os/
11
+ :macosx
12
+ when /linux/
13
+ :linux
14
+ when /solaris|bsd/
15
+ :unix
16
+ else
17
+ raise "unknown os: #{host_os.inspect}"
18
+ end
19
+ )
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module EtFullSystem
2
- VERSION = "0.1.76"
2
+ VERSION = "0.1.77"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: et_full_system
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.76
4
+ version: 0.1.77
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-18 00:00:00.000000000 Z
11
+ date: 2019-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -175,6 +175,7 @@ files:
175
175
  - lib/et_full_system/cli/local.rb
176
176
  - lib/et_full_system/cli/local/file_storage.rb
177
177
  - lib/et_full_system/cli/workspace.rb
178
+ - lib/et_full_system/os.rb
178
179
  - lib/et_full_system/version.rb
179
180
  - shell_scripts/docker_bootstrap.sh
180
181
  - shell_scripts/run_foreman