et_full_system 1.0.1.pre10 → 1.0.1.pre11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/lib/et_full_system/cli/docker.rb +89 -82
- data/lib/et_full_system/cli/local.rb +123 -0
- data/lib/et_full_system/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 508b9e39387ef85680ad1d6dbee3e91995a0f5de3491aa08ee3ff7f86371202e
|
4
|
+
data.tar.gz: '0534904636bb52053f459d86cce29823f06ec152b9c0cf0932041e8c67f398c8'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9a6c95074e206bfe598a165335c8808eb257c363d88800feb35a5ef49e7bc960c68e8a9fb81623f0dd3799e88c3b6576492ddcd3f10bccdd02bbf7288310f0b
|
7
|
+
data.tar.gz: c433e84bd8c6c56bd88ba471ab0f75e9ea885adee126501ddf3e6eebe3820185aa291116bdab1f1f4538b9f19c57c911cea59250ba7f88f9ce6346b265df7aed
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
et_full_system (1.0.1.
|
4
|
+
et_full_system (1.0.1.pre11)
|
5
5
|
aws-sdk-s3 (~> 1.9)
|
6
6
|
azure-storage (~> 0.15.0.preview)
|
7
7
|
dotenv (~> 2.7, >= 2.7.2)
|
@@ -92,7 +92,7 @@ GEM
|
|
92
92
|
mini_portile2 (~> 2.4.0)
|
93
93
|
public_suffix (4.0.3)
|
94
94
|
puma (3.12.2)
|
95
|
-
rack (2.1.
|
95
|
+
rack (2.1.2)
|
96
96
|
rack-protection (2.0.8.1)
|
97
97
|
rack
|
98
98
|
rake (10.5.0)
|
@@ -39,14 +39,8 @@ module EtFullSystem
|
|
39
39
|
end
|
40
40
|
|
41
41
|
desc "invoker", "Provides access to the invoker system running inside docker"
|
42
|
-
def invoker(*args
|
43
|
-
|
44
|
-
gem_root = File.absolute_path('../../..', __dir__)
|
45
|
-
cmd = "GEM_VERSION=#{EtFullSystem::VERSION} docker-compose -f #{gem_root}/docker/docker-compose.yml exec et bash -lc \"invoker #{args.join(' ')}\""
|
46
|
-
puts cmd if show_command
|
47
|
-
result = `#{cmd}`
|
48
|
-
puts result if show_output
|
49
|
-
end
|
42
|
+
def invoker(*args)
|
43
|
+
run_on_local("invoker #{args.join(' ')}")
|
50
44
|
end
|
51
45
|
|
52
46
|
desc "reset", "Bring down the server, remove all caches, rebuild the Dockerfile etc..."
|
@@ -65,13 +59,7 @@ module EtFullSystem
|
|
65
59
|
|
66
60
|
desc "update_service_url SERVICE URL", "Configures the reverse proxy to connect to a specific url for a service - note the URL must be reachable from the docker container and the server must be running"
|
67
61
|
def update_service_url(service, url)
|
68
|
-
|
69
|
-
gem_root = File.absolute_path('../../..', __dir__)
|
70
|
-
cmd = "/bin/bash --login -c \"et_full_system local update_service_url #{service} #{url}\""
|
71
|
-
compose_cmd = "GEM_VERSION=#{EtFullSystem::VERSION} LOCALHOST_FROM_DOCKER_IP=#{host_ip} docker-compose -f #{gem_root}/docker/docker-compose.yml exec et #{cmd}"
|
72
|
-
puts compose_cmd
|
73
|
-
`#{compose_cmd}`
|
74
|
-
end
|
62
|
+
run_on_local("update_service_url #{service} #{url}\"")
|
75
63
|
end
|
76
64
|
|
77
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"
|
@@ -82,17 +70,10 @@ module EtFullSystem
|
|
82
70
|
desc "local_et1 PORT", "Configures the reverse proxy and the invoker system to allow a developer to run the web server and sidekiq locally"
|
83
71
|
def local_et1(port)
|
84
72
|
local_service('et1', port)
|
85
|
-
|
86
|
-
invoker 'remove', 'et1_sidekiq'
|
73
|
+
disable_et1
|
87
74
|
puts "ET1 is now expected to be hosted on port #{port} on your machine. To configure your environment, run 'et_full_system docker et1_env > .env.local'"
|
88
75
|
end
|
89
76
|
|
90
|
-
desc "enable_et1", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
91
|
-
def enable_et1
|
92
|
-
invoker 'add', 'et1_web'
|
93
|
-
invoker 'add', 'et1_sidekiq'
|
94
|
-
puts "ET1 is now being hosted from inside docker container"
|
95
|
-
end
|
96
77
|
|
97
78
|
desc "et1_env", "Shows et1's environment variables as they should be on a developers machine running locally"
|
98
79
|
def et1_env
|
@@ -101,22 +82,10 @@ module EtFullSystem
|
|
101
82
|
|
102
83
|
desc "local_ccd_export", "Disables the sidekiq process in the invoker system to allow a developer to run it locally"
|
103
84
|
def local_ccd_export
|
104
|
-
|
85
|
+
run_on_local('disable_ccd_export')
|
105
86
|
puts "ccd_export is now expected to be running on your machine. To configure your environment, run 'et_full_system docker ccd_export_env > .env.local'"
|
106
87
|
end
|
107
88
|
|
108
|
-
desc "enable_ccd_export", "Configures invoker to use the internal systems instead of local"
|
109
|
-
def enable_ccd_export
|
110
|
-
invoker 'add', 'et_ccd_export_sidekiq'
|
111
|
-
puts "ccd_export is now being run from inside docker container"
|
112
|
-
end
|
113
|
-
|
114
|
-
desc "enable_atos_api", "Configures invoker to use the internal systems instead of local"
|
115
|
-
def enable_atos_api
|
116
|
-
invoker 'add', 'atos_api_web'
|
117
|
-
puts "atos_api is now being run from inside docker container"
|
118
|
-
end
|
119
|
-
|
120
89
|
desc "ccd_export_env", "Shows ccd_export's environment variables as they should be on a developers machine running locally"
|
121
90
|
def ccd_export_env
|
122
91
|
service_env('et_ccd_export')
|
@@ -125,18 +94,10 @@ module EtFullSystem
|
|
125
94
|
desc "local_api PORT", "Configures the reverse proxy and the invoker system to allow a developer to run the web server and sidekiq locally"
|
126
95
|
def local_api(port)
|
127
96
|
local_service('api', port)
|
128
|
-
|
129
|
-
invoker 'remove', 'api_sidekiq'
|
97
|
+
disable_api
|
130
98
|
puts "api is now expected to be hosted on port #{port} on your machine. Also, you must provide your own sidekiq. To configure your environment, run 'et_full_system docker api_env > .env.local'"
|
131
99
|
end
|
132
100
|
|
133
|
-
desc "enable_api", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
134
|
-
def enable_api
|
135
|
-
invoker 'add', 'api_web'
|
136
|
-
invoker 'add', 'api_sidekiq'
|
137
|
-
puts "api is now being hosted from inside docker container"
|
138
|
-
end
|
139
|
-
|
140
101
|
desc "api_env", "Shows api's environment variables as they should be on a developers machine running locally"
|
141
102
|
def api_env
|
142
103
|
service_env('api')
|
@@ -145,16 +106,10 @@ module EtFullSystem
|
|
145
106
|
desc "local_admin PORT", "Configures the reverse proxy and the invoker system to allow a developer to run the admin web server locally"
|
146
107
|
def local_admin(port)
|
147
108
|
local_service('admin', port)
|
148
|
-
|
109
|
+
disable_admin
|
149
110
|
puts "Admin is now expected to be hosted on port #{port} on your machine. To configure your environment, run 'et_full_system docker admin_env > .env.local'"
|
150
111
|
end
|
151
112
|
|
152
|
-
desc "enable_admin", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
153
|
-
def enable_admin
|
154
|
-
invoker 'add', 'admin_web'
|
155
|
-
puts "Admin is now being hosted from inside docker container"
|
156
|
-
end
|
157
|
-
|
158
113
|
desc "admin_env", "Shows admin's environment variables as they should be on a developers machine running locally"
|
159
114
|
def admin_env
|
160
115
|
service_env('admin')
|
@@ -163,15 +118,10 @@ module EtFullSystem
|
|
163
118
|
desc "local_et3 PORT", "Configures the reverse proxy and the invoker system to allow a developer to run the et3 web server locally"
|
164
119
|
def local_et3(port)
|
165
120
|
local_service('et3', port)
|
166
|
-
|
121
|
+
disable_et3
|
167
122
|
puts "ET3 is now expected to be hosted on port #{port} on your machine. To configure your environment, run 'et_full_system docker et3_env > .env.local'"
|
168
123
|
end
|
169
124
|
|
170
|
-
desc "enable_et3", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
171
|
-
def enable_et3
|
172
|
-
invoker 'add', 'et3_web'
|
173
|
-
puts "ET3 is now being hosted from inside docker container"
|
174
|
-
end
|
175
125
|
|
176
126
|
desc "et3_env", "Shows et3's environment variables as they should be on a developers machine running locally"
|
177
127
|
def et3_env
|
@@ -180,58 +130,115 @@ module EtFullSystem
|
|
180
130
|
|
181
131
|
desc "service_env SERVICE", "Returns the environment variables configured for the specified service"
|
182
132
|
def service_env(service)
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
133
|
+
result = run_on_local("service_env #{service}")
|
134
|
+
replace_db_host_port(result)
|
135
|
+
replace_redis_host_port(result)
|
136
|
+
replace_smtp_host_port(result)
|
137
|
+
puts result
|
138
|
+
end
|
139
|
+
|
140
|
+
desc "enable_et1", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
141
|
+
def enable_et1
|
142
|
+
run_on_local("enable_et1")
|
143
|
+
end
|
144
|
+
|
145
|
+
desc "enable_ccd_export", "Configures invoker to use the internal systems instead of local"
|
146
|
+
def enable_ccd_export
|
147
|
+
run_on_local("enable_ccd_export")
|
148
|
+
end
|
149
|
+
|
150
|
+
desc "enable_atos_api", "Configures invoker to use the internal systems instead of local"
|
151
|
+
def enable_atos_api
|
152
|
+
run_on_local("enable_atos_api")
|
153
|
+
end
|
154
|
+
|
155
|
+
desc "enable_api", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
156
|
+
def enable_api
|
157
|
+
run_on_local("enable_api")
|
158
|
+
end
|
159
|
+
|
160
|
+
desc "enable_admin", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
161
|
+
def enable_admin
|
162
|
+
run_on_local("enable_admin")
|
163
|
+
end
|
164
|
+
|
165
|
+
desc "enable_et3", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
166
|
+
def enable_et3
|
167
|
+
run_on_local("enable_et3")
|
168
|
+
end
|
169
|
+
|
170
|
+
desc "disable_et1", "Stops et1 from running in the stack"
|
171
|
+
def disable_et1
|
172
|
+
run_on_local("disable_et1")
|
173
|
+
end
|
174
|
+
|
175
|
+
desc "disable_ccd_export", "Stops ccd_export from running in the stack"
|
176
|
+
def disable_ccd_export
|
177
|
+
run_on_local("disable_ccd_export")
|
178
|
+
end
|
179
|
+
|
180
|
+
desc "disable_atos_api", "Stops atos_api running in the stack"
|
181
|
+
def disable_atos_api
|
182
|
+
run_on_local("disable_atos_api")
|
183
|
+
end
|
184
|
+
|
185
|
+
desc "disable_api", "Stops api from running in the stack"
|
186
|
+
def disable_api
|
187
|
+
run_on_local("disable_api")
|
188
|
+
end
|
189
|
+
|
190
|
+
desc "disable_admin", "Stops admin from running in the stack"
|
191
|
+
def disable_admin
|
192
|
+
run_on_local("disable_admin")
|
193
|
+
end
|
194
|
+
|
195
|
+
desc "disable_et3", "Stops et3 from running in the stack"
|
196
|
+
def disable_et3
|
197
|
+
run_on_local("disable_et3")
|
193
198
|
end
|
194
199
|
|
195
200
|
desc "restart_et1", "Restarts the et1 application"
|
196
201
|
def restart_et1
|
197
|
-
|
198
|
-
invoker 'reload', 'et1_sidekiq'
|
199
|
-
puts "ET1 Has been restarted"
|
202
|
+
run_on_local("restart_et1")
|
200
203
|
end
|
201
204
|
|
202
205
|
desc "restart_api", "Restarts the api application"
|
203
206
|
def restart_api
|
204
|
-
|
205
|
-
invoker 'reload', 'api_sidekiq'
|
206
|
-
puts "api Has been restarted"
|
207
|
+
run_on_local("restart_api")
|
207
208
|
end
|
208
209
|
|
209
210
|
desc "restart_et3", "Restarts the et3 application"
|
210
211
|
def restart_et3
|
211
|
-
|
212
|
-
puts "et3 Has been restarted"
|
212
|
+
run_on_local("restart_et3")
|
213
213
|
end
|
214
214
|
|
215
215
|
desc "restart_admin", "Restarts the admin application"
|
216
216
|
def restart_admin
|
217
|
-
|
218
|
-
puts "admin Has been restarted"
|
217
|
+
run_on_local("restart_admin")
|
219
218
|
end
|
220
219
|
|
221
220
|
desc "restart_atos_api", "Restarts the atos_api application"
|
222
221
|
def restart_atos_api
|
223
|
-
|
224
|
-
puts "atos_api Has been restarted"
|
222
|
+
run_on_local("restart_atos_api")
|
225
223
|
end
|
226
224
|
|
227
225
|
desc "restart_ccd_export", "Restarts the ccd_export application"
|
228
226
|
def restart_ccd_export
|
229
|
-
|
230
|
-
puts "ccd_export Has been restarted"
|
227
|
+
run_on_local("restart_ccd_export")
|
231
228
|
end
|
232
229
|
|
233
230
|
private
|
234
231
|
|
232
|
+
def run_on_local(cmd)
|
233
|
+
Bundler.with_unbundled_env do
|
234
|
+
gem_root = File.absolute_path('../../..', __dir__)
|
235
|
+
cmd = "/bin/bash --login -c \"et_full_system local #{cmd}\""
|
236
|
+
compose_cmd = "GEM_VERSION=#{EtFullSystem::VERSION} LOCALHOST_FROM_DOCKER_IP=#{host_ip} docker-compose -f #{gem_root}/docker/docker-compose.yml exec et #{cmd}"
|
237
|
+
puts compose_cmd
|
238
|
+
`#{compose_cmd}`
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
235
242
|
def run_compose_command(*args, silent: false)
|
236
243
|
Bundler.with_unbundled_env do
|
237
244
|
gem_root = File.absolute_path('../../..', __dir__)
|
@@ -168,6 +168,129 @@ module EtFullSystem
|
|
168
168
|
puts "The service must be one of #{lookup.keys}"
|
169
169
|
end
|
170
170
|
|
171
|
+
desc "invoker", "Provides access to the invoker system"
|
172
|
+
def invoker(*args)
|
173
|
+
cmd = "invoker #{args.join(' ')}"
|
174
|
+
puts cmd
|
175
|
+
result = `#{cmd}`
|
176
|
+
puts result
|
177
|
+
result
|
178
|
+
end
|
179
|
+
|
180
|
+
desc "enable_et1", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
181
|
+
def enable_et1
|
182
|
+
invoker 'add', 'et1_web'
|
183
|
+
invoker 'add', 'et1_sidekiq'
|
184
|
+
puts "ET1 is now running"
|
185
|
+
end
|
186
|
+
|
187
|
+
desc "enable_ccd_export", "Configures invoker to use the internal systems instead of local"
|
188
|
+
def enable_ccd_export
|
189
|
+
invoker 'add', 'et_ccd_export_sidekiq'
|
190
|
+
puts "ccd_export is now running"
|
191
|
+
end
|
192
|
+
|
193
|
+
desc "enable_atos_api", "Configures invoker to use the internal systems instead of local"
|
194
|
+
def enable_atos_api
|
195
|
+
invoker 'add', 'atos_api_web'
|
196
|
+
puts "atos_api is now running"
|
197
|
+
end
|
198
|
+
|
199
|
+
desc "enable_api", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
200
|
+
def enable_api
|
201
|
+
invoker 'add', 'api_web'
|
202
|
+
invoker 'add', 'api_sidekiq'
|
203
|
+
puts "api is now running"
|
204
|
+
end
|
205
|
+
|
206
|
+
desc "enable_admin", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
207
|
+
def enable_admin
|
208
|
+
invoker 'add', 'admin_web'
|
209
|
+
puts "Admin is now running"
|
210
|
+
end
|
211
|
+
|
212
|
+
desc "enable_et3", "Configures the reverse proxy and invoker to use the internal systems instead of local"
|
213
|
+
def enable_et3
|
214
|
+
invoker 'add', 'et3_web'
|
215
|
+
puts "ET3 is now running"
|
216
|
+
end
|
217
|
+
|
218
|
+
desc "disable_et1", "Stops <service> from running in the stack"
|
219
|
+
def disable_et1
|
220
|
+
invoker 'remove', 'et1_web'
|
221
|
+
invoker 'remove', 'et1_sidekiq'
|
222
|
+
puts "ET1 is now stopped"
|
223
|
+
end
|
224
|
+
|
225
|
+
desc "disable_ccd_export", "Stops ccd_export from running in the stack"
|
226
|
+
def disable_ccd_export
|
227
|
+
invoker 'remove', 'et_ccd_export_sidekiq'
|
228
|
+
puts "ccd_export is now stopped"
|
229
|
+
end
|
230
|
+
|
231
|
+
desc "disable_atos_api", "Stops atos_api from running in the stack"
|
232
|
+
def disable_atos_api
|
233
|
+
invoker 'remove', 'atos_api_web'
|
234
|
+
puts "atos_api is now stopped"
|
235
|
+
end
|
236
|
+
|
237
|
+
desc "disable_api", "Stops api from running in the stack"
|
238
|
+
def disable_api
|
239
|
+
invoker 'remove', 'api_web'
|
240
|
+
invoker 'remove', 'api_sidekiq'
|
241
|
+
puts "api is now stopped"
|
242
|
+
end
|
243
|
+
|
244
|
+
desc "disable_admin", "Stops admin from running in the stack"
|
245
|
+
def disable_admin
|
246
|
+
invoker 'remove', 'admin_web'
|
247
|
+
puts "Admin is now stopped"
|
248
|
+
end
|
249
|
+
|
250
|
+
desc "disable_et3", "Stops et3 from running in the stack"
|
251
|
+
def disable_et3
|
252
|
+
invoker 'remove', 'et3_web'
|
253
|
+
puts "ET3 is now stopped"
|
254
|
+
end
|
255
|
+
|
256
|
+
desc "restart_et1", "Restarts the et1 application"
|
257
|
+
def restart_et1
|
258
|
+
invoker 'reload', 'et1_web'
|
259
|
+
invoker 'reload', 'et1_sidekiq'
|
260
|
+
puts "ET1 Has been restarted"
|
261
|
+
end
|
262
|
+
|
263
|
+
desc "restart_api", "Restarts the api application"
|
264
|
+
def restart_api
|
265
|
+
invoker 'reload', 'api_web'
|
266
|
+
invoker 'reload', 'api_sidekiq'
|
267
|
+
puts "api Has been restarted"
|
268
|
+
end
|
269
|
+
|
270
|
+
desc "restart_et3", "Restarts the et3 application"
|
271
|
+
def restart_et3
|
272
|
+
invoker 'reload', 'et3_web'
|
273
|
+
puts "et3 Has been restarted"
|
274
|
+
end
|
275
|
+
|
276
|
+
desc "restart_admin", "Restarts the admin application"
|
277
|
+
def restart_admin
|
278
|
+
invoker 'reload', 'admin_web'
|
279
|
+
puts "admin Has been restarted"
|
280
|
+
end
|
281
|
+
|
282
|
+
desc "restart_atos_api", "Restarts the atos_api application"
|
283
|
+
def restart_atos_api
|
284
|
+
invoker 'reload', 'atos_api_web'
|
285
|
+
puts "atos_api Has been restarted"
|
286
|
+
end
|
287
|
+
|
288
|
+
desc "restart_ccd_export", "Restarts the ccd_export application"
|
289
|
+
def restart_ccd_export
|
290
|
+
invoker 'reload', 'et_ccd_export_sidekiq'
|
291
|
+
puts "ccd_export Has been restarted"
|
292
|
+
end
|
293
|
+
|
171
294
|
private
|
172
295
|
|
173
296
|
def invoker_processes_for(service)
|
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: 1.0.1.
|
4
|
+
version: 1.0.1.pre11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|