et_full_system 1.0.0 → 1.0.1.pre4

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: 2b2894ada07cd8b72a702d2727617b84839921134c1b10c238fa000e547d613d
4
- data.tar.gz: dfb43dc20072b09ae299239ae58b2cb5e45899d34dba5e1f3a115050d55d1e7f
3
+ metadata.gz: 6beef42f9d18b4c7e277eb13c29ac2cd7e6c7faf8509f03479cf39db6c6a0516
4
+ data.tar.gz: 7c34827c01f39d2994555cb7429cd62a482c93cc5810a811aaa5684785637895
5
5
  SHA512:
6
- metadata.gz: 9fdbff1b0639e733cdbb504ddf747d4a00ddad025cef8fcf13814d7137ec81c5d08afc5744427fc383772a36480f5bc895a0ce0f8ac3130337f56cf018106b31
7
- data.tar.gz: fc3a77bfda7cbf97d5468eb5d26121fb554515b60f0f98c508bb8519aa39b96fd8e3c24984dbf3277b20d2c64d11e6a7d4671baa9a21e145fc1ee3e7a3797df1
6
+ metadata.gz: e2b5cc72dac96c68b58f7389b9c91b8a5de3bcf8ed562b7f411e07a7c94568cf6625cf3fd428b6aded5958b131ed41d38fcf534c0e969b4959f0f41e9f8e2ed0
7
+ data.tar.gz: a3de0af6328cb80a45e460bd5fccc1317c26569b51156a72bb7e255009149c69563fb869a7bb4fcb160b1353b6b663c296b1d0edd6a80a882e8906c91900da24
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- et_full_system (1.0.0)
4
+ et_full_system (1.0.1.pre4)
5
5
  aws-sdk-s3 (~> 1.9)
6
6
  azure-storage (~> 0.15.0.preview)
7
7
  dotenv (~> 2.7, >= 2.7.2)
@@ -23,13 +23,13 @@ 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.266.0)
26
+ aws-partitions (1.269.0)
27
27
  aws-sdk-core (3.89.1)
28
28
  aws-eventstream (~> 1.0, >= 1.0.2)
29
29
  aws-partitions (~> 1, >= 1.239.0)
30
30
  aws-sigv4 (~> 1.1)
31
31
  jmespath (~> 1.0)
32
- aws-sdk-kms (1.27.0)
32
+ aws-sdk-kms (1.28.0)
33
33
  aws-sdk-core (~> 3, >= 3.71.0)
34
34
  aws-sigv4 (~> 1.1)
35
35
  aws-sdk-s3 (1.60.1)
@@ -11,13 +11,15 @@ module EtFullSystem
11
11
  method_option :ccd_docker, type: :boolean, default: false, aliases: 'ccd-docker', desc: "If specified, instead of using the built in fake ccd server, the system will connect to your local machine (see ccd-docker-host option also)"
12
12
  method_option :ccd_docker_host, type: :string, default: 'docker.for.mac.localhost', aliases: 'ccd-docker-host', desc: "Only used if ccd-docker=true. This specifies the host name of your machine when viewed from inside the docker container. This defaults to docker.for.mac.localhost which is suitable for mac OSX only. Consult docker documentation for other systems"
13
13
  method_option :with_test, type: :boolean, default: false, aliases: 'with-test'
14
- method_option :use_selenium, type: :boolean, default: true, aliases: 'use-selenium', desc: 'Only used if with_test is true - says to use selenium in preference to zalenium'
14
+ method_option :use_selenium, type: :boolean, default: false, aliases: 'use-selenium', desc: 'Only used if with_test is true - says to use selenium in preference to zalenium'
15
15
  method_option :chrome_instances, type: :numeric, default: 1, aliases: 'chrome-instances', desc: 'Specify the number of chrome instances for selenium'
16
16
  method_option :firefox_instances, type: :numeric, default: 1, aliases: 'firefox-instances', desc: 'Specify the number of firefox instances for selenium'
17
- method_option :record_video, type: :boolean, default: true, aliases: 'record-video', desc: 'When using zalenium, enable video recording'
17
+ method_option :record_video, type: :boolean, default: false, aliases: 'record-video', desc: 'When using zalenium, enable video recording'
18
+ method_option :minimal, type: :boolean, default: false, desc: 'Set to true to only start the minimum (db, redis, mail, s3, azure blob, fake_acas, fake_ccd)'
18
19
  def up(*args)
19
20
  Bundler.with_original_env do
20
21
  server_args = []
22
+ server_args << "--minimal" if options.minimal?
21
23
  server_args << "--without=#{options[:without].join(' ')}" unless options[:without].empty?
22
24
  env_vars = ["SERVER_ARGS='#{server_args.join(' ')}'"]
23
25
  env_vars << "LOCALHOST_FROM_DOCKER_IP=#{host_ip}"
@@ -87,8 +87,8 @@ module EtFullSystem
87
87
  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
88
  end
89
89
 
90
- desc "reset_et1", "Configures the reverse proxy and invoker to use the internal systems instead of local"
91
- def reset_et1
90
+ desc "enable_et1", "Configures the reverse proxy and invoker to use the internal systems instead of local"
91
+ def enable_et1
92
92
  invoker 'add', 'et1_web'
93
93
  invoker 'add', 'et1_sidekiq'
94
94
  puts "ET1 is now being hosted from inside docker container"
@@ -105,8 +105,8 @@ module EtFullSystem
105
105
  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
106
  end
107
107
 
108
- desc "reset_ccd_export", "Configures invoker to use the internal systems instead of local"
109
- def reset_ccd_export
108
+ desc "enable_ccd_export", "Configures invoker to use the internal systems instead of local"
109
+ def enable_ccd_export
110
110
  invoker 'add', 'et_ccd_export_sidekiq'
111
111
  puts "ccd_export is now being run from inside docker container"
112
112
  end
@@ -124,8 +124,8 @@ module EtFullSystem
124
124
  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'"
125
125
  end
126
126
 
127
- desc "reset_api", "Configures the reverse proxy and invoker to use the internal systems instead of local"
128
- def reset_api
127
+ desc "enable_api", "Configures the reverse proxy and invoker to use the internal systems instead of local"
128
+ def enable_api
129
129
  invoker 'add', 'api_web'
130
130
  invoker 'add', 'api_sidekiq'
131
131
  puts "api is now being hosted from inside docker container"
@@ -143,8 +143,8 @@ module EtFullSystem
143
143
  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'"
144
144
  end
145
145
 
146
- desc "reset_admin", "Configures the reverse proxy and invoker to use the internal systems instead of local"
147
- def reset_admin
146
+ desc "enable_admin", "Configures the reverse proxy and invoker to use the internal systems instead of local"
147
+ def enable_admin
148
148
  invoker 'add', 'admin_web'
149
149
  puts "Admin is now being hosted from inside docker container"
150
150
  end
@@ -161,8 +161,8 @@ module EtFullSystem
161
161
  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'"
162
162
  end
163
163
 
164
- desc "reset_et3", "Configures the reverse proxy and invoker to use the internal systems instead of local"
165
- def reset_et3
164
+ desc "enable_et3", "Configures the reverse proxy and invoker to use the internal systems instead of local"
165
+ def enable_et3
166
166
  invoker 'add', 'et3_web'
167
167
  puts "ET3 is now being hosted from inside docker container"
168
168
  end
@@ -186,6 +186,44 @@ module EtFullSystem
186
186
  end
187
187
  end
188
188
 
189
+ desc "restart_et1", "Restarts the et1 application"
190
+ def restart_et1
191
+ invoker 'reload', 'et1_web'
192
+ invoker 'reload', 'et1_sidekiq'
193
+ puts "ET1 Has been restarted"
194
+ end
195
+
196
+ desc "restart_api", "Restarts the api application"
197
+ def restart_api
198
+ invoker 'reload', 'api_web'
199
+ invoker 'reload', 'api_sidekiq'
200
+ puts "api Has been restarted"
201
+ end
202
+
203
+ desc "restart_et3", "Restarts the et3 application"
204
+ def restart_et3
205
+ invoker 'reload', 'et3_web'
206
+ puts "et3 Has been restarted"
207
+ end
208
+
209
+ desc "restart_admin", "Restarts the admin application"
210
+ def restart_admin
211
+ invoker 'reload', 'admin_web'
212
+ puts "admin Has been restarted"
213
+ end
214
+
215
+ desc "restart_atos_api", "Restarts the atos_api application"
216
+ def restart_atos_api
217
+ invoker 'reload', 'atos_api_web'
218
+ puts "atos_api Has been restarted"
219
+ end
220
+
221
+ desc "restart_ccd_export", "Restarts the ccd_export application"
222
+ def restart_ccd_export
223
+ invoker 'reload', 'et_ccd_export_sidekiq'
224
+ puts "ccd_export Has been restarted"
225
+ end
226
+
189
227
  private
190
228
 
191
229
  def run_compose_command(*args, silent: false)
@@ -84,6 +84,7 @@ module EtFullSystem
84
84
  method_option :minio_storage_path, default: ENV.fetch('MINIO_STORAGE_PATH', '/tmp/minio_storage'), desc: "Where to store minio data"
85
85
  method_option :rails_env, type: :string, default: ENV.fetch('RAILS_ENV', 'production')
86
86
  method_option :cloud_provider, type: :string, default: ENV.fetch('CLOUD_PROVIDER', 'amazon')
87
+ method_option :minimal, type: :boolean, default: false, desc: 'Set to true to only start the minimum (db, redis, mail, s3, azure blob, fake_acas, fake_ccd)'
87
88
  def server
88
89
  puts "Scheduling traefik config and file storage config"
89
90
  pid = fork do
@@ -92,12 +93,23 @@ module EtFullSystem
92
93
  end
93
94
  Process.detach(pid)
94
95
 
95
- puts "Starting Procfile"
96
+ puts "Starting Invoker"
96
97
  ::Bundler.with_original_env do
97
- concurrency = " -c #{procfile_concurrency_without(options[:without]).join(',')}"
98
+ without = options[:without]
99
+ if options.minimal?
100
+ without = ['et1', 'et3', 'admin', 'api', 'ccd_export', 'atos_api']
101
+ end
98
102
  cmd = "CLOUD_PROVIDER=#{options[:cloud_provider]} RAILS_ENV=#{options[:rails_env]} AZURITE_STORAGE_PATH=\"#{options[:azurite_storage_path]}\" MINIO_STORAGE_PATH=\"#{options[:minio_storage_path]}\" FS_ROOT_PATH=#{PROJECT_PATH} FOREMAN_PATH=#{GEM_PATH}/foreman godotenv -f #{GEM_PATH}/foreman/.env invoker start \"#{GEM_PATH}/foreman/Procfile\" --port=4000"
99
103
  STDERR.puts cmd
100
- exec(cmd)
104
+ puts `#{cmd}`
105
+ return if without.empty?
106
+
107
+
108
+ stop_cmds = without.reduce([]) do |acc, service|
109
+ acc.concat(invoker_processes_for(service))
110
+ end
111
+ stop_cmd = stop_cmds.join(' && ')
112
+ puts `#{stop_cmd}`
101
113
  end
102
114
  end
103
115
 
@@ -159,10 +171,6 @@ module EtFullSystem
159
171
  end
160
172
  end
161
173
 
162
- def procfile_concurrency_without(without)
163
- procfile_services.map {|service| "#{service}=#{without.include?(service) ? 0 : 1}"}
164
- end
165
-
166
174
  def external_command(cmd, tag)
167
175
  IO.popen(cmd) do |io|
168
176
  io.each do |line|
@@ -1,3 +1,3 @@
1
1
  module EtFullSystem
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1.pre4"
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: 1.0.0
4
+ version: 1.0.1.pre4
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-20 00:00:00.000000000 Z
11
+ date: 2020-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -195,12 +195,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  requirements:
198
- - - ">="
198
+ - - ">"
199
199
  - !ruby/object:Gem::Version
200
- version: '0'
200
+ version: 1.3.1
201
201
  requirements: []
202
- rubyforge_project:
203
- rubygems_version: 2.7.7
202
+ rubygems_version: 3.0.6
204
203
  signing_key:
205
204
  specification_version: 4
206
205
  summary: Runs the employment tribunals system - all services and background jobs