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 +4 -4
- data/Gemfile.lock +1 -1
- data/foreman/.env +2 -0
- data/lib/et_full_system/cli/docker.rb +33 -1
- data/lib/et_full_system/cli/local.rb +2 -1
- data/lib/et_full_system/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf30e87b89f12fe27b013d6a107f3e692deaef4fa4aaa095d004aea2baf1162e
|
4
|
+
data.tar.gz: 1aaaba9f339201bf68982b2ee220c38622a0971c1f4fb7cae87e59688085c924
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2dc2f83cdcc789599b82ddd0868171f39cce77044216268345c75b0c423252325276723c60e36114973aa2ed55c4efc06010980d3fd19631857b9382f06144f
|
7
|
+
data.tar.gz: 8b293bc0aa9eb0b938589114da4e5489c98ccd5915cbc60c6211c5be0db3e1d2e3c5e3e1a6ccb3d1dc64a222af9b137dd29142fe2cc2f66336f57613316cd430
|
data/Gemfile.lock
CHANGED
data/foreman/.env
CHANGED
@@ -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
|
-
|
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
|