et_full_system 1.0.0.pre19 → 1.0.0.pre25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14ec03e610ed34c4ccbb7e778910882c5730c9d9e8215a6186d86d4e907adcfd
4
- data.tar.gz: 853c84d37c911dde2b262fc5fd3ee1641ad8218a4efd5ac00c899216c2a18408
3
+ metadata.gz: bf30e87b89f12fe27b013d6a107f3e692deaef4fa4aaa095d004aea2baf1162e
4
+ data.tar.gz: 1aaaba9f339201bf68982b2ee220c38622a0971c1f4fb7cae87e59688085c924
5
5
  SHA512:
6
- metadata.gz: 274e21e7e359f0f893dba6de9729899803d7e6c5ff1c74eea541b4d3dd1c8c24f0809f59908c7a2f7ed0a8302b847726efb6fa467e75cd2d79a5efd00bcd68f8
7
- data.tar.gz: f556dc33c0690dd981a780df6363ea268c0c85696de8fb17a15117603b61e867c23c04f268a1f18ee310e2083daef6255e1e51dc04c95f5d239e2142ac02da37
6
+ metadata.gz: d2dc2f83cdcc789599b82ddd0868171f39cce77044216268345c75b0c423252325276723c60e36114973aa2ed55c4efc06010980d3fd19631857b9382f06144f
7
+ data.tar.gz: 8b293bc0aa9eb0b938589114da4e5489c98ccd5915cbc60c6211c5be0db3e1d2e3c5e3e1a6ccb3d1dc64a222af9b137dd29142fe2cc2f66336f57613316cd430
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- et_full_system (1.0.0.pre18)
4
+ et_full_system (1.0.0.pre25)
5
5
  aws-sdk-s3 (~> 1.9)
6
6
  azure-storage (~> 0.15.0.preview)
7
7
  dotenv (~> 2.7, >= 2.7.2)
data/foreman/.env CHANGED
@@ -1,6 +1,8 @@
1
1
  DB_HOST=${DB_HOST}
2
+ DB_PORT=5432
2
3
  DB_USERNAME=postgres
3
4
  REDIS_HOST=${REDIS_HOST}
5
+ REDIS_PORT=6379
4
6
  RAILS_LOG_TO_STDOUT='true'
5
7
  WEB_CONCURRENCY=1
6
8
  SECRET_KEY_BASE=sdlkjewfkjhfviuhduihenrjk435r89esfd7cv983qh2n4r3q27yh4u5rtfg
@@ -85,12 +85,24 @@ module EtFullSystem
85
85
  cmd = "/bin/bash --login -c \"et_full_system local service_env #{service}\""
86
86
  compose_cmd = "GEM_VERSION=#{EtFullSystem::VERSION} docker-compose -f #{gem_root}/docker/docker-compose.yml exec et #{cmd}"
87
87
  puts compose_cmd
88
- exec(compose_cmd)
88
+ result = `#{compose_cmd}`
89
+ replace_db_host_port(result)
90
+ replace_redis_host_port(result)
91
+ puts result
89
92
  end
90
93
  end
91
94
 
92
95
  private
93
96
 
97
+ def run_compose_command(*args, silent: false)
98
+ Bundler.with_original_env do
99
+ gem_root = File.absolute_path('../../..', __dir__)
100
+ cmd = "GEM_VERSION=#{EtFullSystem::VERSION} docker-compose -f #{gem_root}/docker/docker-compose.yml #{args.join(' ')}"
101
+ puts cmd unless silent
102
+ `#{cmd}`
103
+ end
104
+ end
105
+
94
106
  def host_ip
95
107
  result = JSON.parse `docker network inspect \`docker network list | grep docker_et_full_system | awk '{print $1}'\``
96
108
  result.first.dig('IPAM', 'Config').first['Gateway']
@@ -108,5 +120,25 @@ module EtFullSystem
108
120
  raise "Unknown host type - this tool only supports mac, linux and windows"
109
121
  end
110
122
  end
123
+
124
+ def replace_db_host_port(env)
125
+ env.gsub!(/^DB_HOST=.*$/, 'DB_HOST=localhost')
126
+ env.gsub!(/^DB_PORT=.*$/, "DB_PORT=#{db_port}")
127
+ end
128
+
129
+ def replace_redis_host_port(env)
130
+ env.gsub!(/^REDIS_HOST=.*$/, 'REDIS_HOST=localhost')
131
+ env.gsub!(/^REDIS_PORT=.*$/, "REDIS_PORT=#{redis_port}")
132
+ end
133
+
134
+ def db_port
135
+ result = run_compose_command :port, :db, 5432
136
+ result.split(':').last
137
+ end
138
+
139
+ def redis_port
140
+ result = run_compose_command :port, :redis, 6379
141
+ result.split(':').last
142
+ end
111
143
  end
112
144
  end
@@ -146,7 +146,8 @@ module EtFullSystem
146
146
  parsed.each_pair do |name, value|
147
147
  puts "#{name}=#{value}"
148
148
  end
149
-
149
+ rescue KeyError
150
+ puts "The service must be one of #{lookup.keys}"
150
151
  end
151
152
 
152
153
  private
@@ -1,3 +1,3 @@
1
1
  module EtFullSystem
2
- VERSION = "1.0.0.pre19"
2
+ VERSION = "1.0.0.pre25"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: et_full_system
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre19
4
+ version: 1.0.0.pre25
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor