inferno_core 0.4.29 → 0.4.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/lib/inferno/apps/cli/new.rb +42 -18
  3. data/lib/inferno/apps/cli/templates/%library_name%.gemspec.tt +26 -0
  4. data/lib/inferno/apps/cli/templates/Dockerfile.tt +22 -0
  5. data/lib/inferno/apps/cli/templates/Gemfile.tt +9 -0
  6. data/lib/inferno/apps/cli/templates/LICENSE.tt +201 -0
  7. data/lib/inferno/apps/cli/templates/Procfile.tt +2 -0
  8. data/lib/inferno/apps/cli/templates/README.md.tt +41 -0
  9. data/lib/inferno/apps/cli/templates/Rakefile.tt +15 -0
  10. data/lib/inferno/apps/cli/templates/config/database.yml.tt +18 -0
  11. data/lib/inferno/apps/cli/templates/config/nginx.background.conf.tt +86 -0
  12. data/lib/inferno/apps/cli/templates/config/nginx.conf.tt +101 -0
  13. data/lib/inferno/apps/cli/templates/config/puma.rb.tt +2 -0
  14. data/lib/inferno/apps/cli/templates/config.ru.tt +11 -0
  15. data/lib/inferno/apps/cli/templates/docker-compose.background.yml.tt +30 -0
  16. data/lib/inferno/apps/cli/templates/docker-compose.yml.tt +35 -0
  17. data/lib/inferno/apps/cli/templates/lib/%library_name%/igs/put_ig_package_dot_tgz_here +0 -0
  18. data/lib/inferno/apps/cli/templates/lib/%library_name%/patient_group.rb.tt +44 -0
  19. data/lib/inferno/apps/cli/templates/lib/%library_name%.rb.tt +53 -0
  20. data/lib/inferno/apps/cli/templates/run.sh +3 -0
  21. data/lib/inferno/apps/cli/templates/setup.sh +4 -0
  22. data/lib/inferno/apps/cli/templates/spec/%library_name%/patient_group_spec.rb.tt +105 -0
  23. data/lib/inferno/apps/cli/templates/spec/spec_helper.rb.tt +141 -0
  24. data/lib/inferno/apps/cli/templates/worker.rb.tt +3 -0
  25. data/lib/inferno/db/migrations/010_add_validator_sessions.rb +14 -0
  26. data/lib/inferno/db/schema.rb +14 -0
  27. data/lib/inferno/dsl/fhir_client_builder.rb +1 -1
  28. data/lib/inferno/dsl/fhir_resource_validation.rb +21 -7
  29. data/lib/inferno/dsl/http_client_builder.rb +1 -1
  30. data/lib/inferno/entities/validator_session.rb +22 -0
  31. data/lib/inferno/entities.rb +1 -0
  32. data/lib/inferno/jobs/invoke_validator_session.rb +3 -3
  33. data/lib/inferno/public/175.bundle.js +1 -0
  34. data/lib/inferno/public/assets.json +1 -1
  35. data/lib/inferno/public/bundle.js +21 -21
  36. data/lib/inferno/public/bundle.js.LICENSE.txt +17 -5
  37. data/lib/inferno/repositories/validator_sessions.rb +58 -0
  38. data/lib/inferno/repositories.rb +1 -0
  39. data/lib/inferno/utils/ig_downloader.rb +57 -0
  40. data/lib/inferno/version.rb +1 -1
  41. metadata +29 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 71ffd4d8151e890a5a52cd087d5aeb222efcf27902c2ec01f78d898a08de7d9b
4
- data.tar.gz: afe5c2b4cf3603e54e4b085dc609f061d6e78bd929e1b4ee915294dcb0f87de6
3
+ metadata.gz: 2cc7cf96fbaba860fa20b9d3ce24ece91e898f06006974536c46d15d0f875888
4
+ data.tar.gz: 84eabfe9895b4dcd17d251b51e6cc7dceb9132ed7af66a3d0c707d6126e343ed
5
5
  SHA512:
6
- metadata.gz: e0caf2d09c500643311b393129a741a9bd8d3ee043d7b6e45c3cad5cd92eb50802642de5c3222bf62188d1ecbe48469c5b54cf2f3005f65548d544b8ac2f6d30
7
- data.tar.gz: bb530410e8303d6fc82132c0f8c3da0fc63987ac6ba48b2be1023d8021ed7350a5158d3941e5bc7090136986248bae9134a64fbf8c6432352bb98ae839abff91
6
+ metadata.gz: 7772ee37760aed0f39a36972f0d6881166d7caef69d62b3df6f868f26d1f5948928dc8a05e392aaa35af11cb71f11cf7f18ed8d47fcefa1efa431f3685872319
7
+ data.tar.gz: bf9319e60aff26082d19e67260ca93bb0e39304111f63a1ece0e4307b52c55a6da8a3959e227ea61c2848607f58a2087b340533d6e690125789f0b565919724c
@@ -1,6 +1,7 @@
1
1
  require 'thor'
2
2
  require 'bundler'
3
3
  require_relative '../../utils/named_thor_actions'
4
+ require_relative '../../utils/ig_downloader'
4
5
  require_relative '../../version'
5
6
 
6
7
  module Inferno
@@ -8,17 +9,27 @@ module Inferno
8
9
  class New < Thor::Group
9
10
  include Thor::Actions
10
11
  include Inferno::Utils::NamedThorActions
12
+ include Inferno::Utils::IgDownloader
11
13
 
12
14
  desc <<~HELP
13
15
  Generate a new Inferno test kit for FHIR software testing
14
16
 
15
17
  Examples:
16
18
 
17
- `inferno new test_fhir_app`
18
- => generates an Inferno app
19
+ `inferno new my_test_kit`
20
+ => generates an Inferno test kit
19
21
 
20
- `inferno new test_my_ig -a MyName`
21
- => generates Inferno app and specifies MyName as gemspec author
22
+ `inferno new test-us-core -i hl7.fhir.us.core@6.1.0`
23
+ => generates Inferno test kit with US Core 6.1.0 implementation guide
24
+
25
+ `inferno new TestMatching -i https://build.fhir.org/ig/HL7/fhir-identity-matching-ig/`
26
+ => generates Inferno test kit with an implementation guide from its continuous web build
27
+
28
+ `inferno new test-my-ig -a "My Name" -i file:///absolute/path/to/my/ig/package.tgz`
29
+ => generates Inferno test kit with a local IG and specifies My Name as gem author
30
+
31
+ `inferno new test_my_igs -a "My Name" -a "Another Name" -i file:///my/first/package.tgz -i hl7.fhir.us.core@6.1.0`
32
+ => generates Inferno test kit with multiple IGs and multiple authors
22
33
 
23
34
  https://inferno-framework.github.io/index.html
24
35
  HELP
@@ -45,15 +56,23 @@ module Inferno
45
56
  type: :boolean,
46
57
  aliases: '-b',
47
58
  default: false,
48
- desc: 'Do not run bundle install'
59
+ desc: 'Do not run bundle install or inferno migrate'
60
+ class_option :implementation_guide,
61
+ type: :string,
62
+ aliases: '-i',
63
+ repeatable: true,
64
+ desc: 'Load an Implementation Guide by FHIR Registry name, URL, or absolute path'
49
65
 
50
66
  add_runtime_options!
51
67
 
52
- def create_app
68
+ def create_test_kit
53
69
  directory('.', root_name, { mode: :preserve, recursive: true, verbose: !options['quiet'] })
54
70
 
55
- bundle_install
56
- inferno_migrate
71
+ inside(root_name) do
72
+ bundle_install
73
+ inferno_migrate
74
+ load_igs
75
+ end
57
76
 
58
77
  say_unless_quiet "Created #{root_name} Inferno test kit!", :green
59
78
 
@@ -65,10 +84,6 @@ module Inferno
65
84
 
66
85
  private
67
86
 
68
- def ig_path
69
- File.join('lib', library_name, 'igs')
70
- end
71
-
72
87
  def authors
73
88
  options['author'].presence || [default_author]
74
89
  end
@@ -80,18 +95,27 @@ module Inferno
80
95
  def bundle_install
81
96
  return if options['skip_bundle']
82
97
 
83
- inside(root_name) do
84
- Bundler.with_unbundled_env do
85
- run 'bundle install', verbose: !options['quiet'], capture: options['quiet']
86
- end
98
+ Bundler.with_unbundled_env do
99
+ run 'bundle install', verbose: !options['quiet'], capture: options['quiet']
87
100
  end
88
101
  end
89
102
 
90
103
  def inferno_migrate
91
104
  return if options['skip_bundle']
92
105
 
93
- inside(root_name) do
94
- run 'bundle exec inferno migrate', verbose: !options['quiet'], capture: options['quiet']
106
+ run 'bundle exec inferno migrate', verbose: !options['quiet'], capture: options['quiet']
107
+ end
108
+
109
+ def load_igs
110
+ config = { verbose: !options['quiet'] }
111
+ options['implementation_guide']&.each_with_index do |ig, idx|
112
+ uri = options['implementation_guide'].length == 1 ? load_ig(ig, nil, config) : load_ig(ig, idx, config)
113
+ say_unless_quiet "Downloaded IG from #{uri}"
114
+ rescue OpenURI::HTTPError => e
115
+ say_unless_quiet "Failed to install implementation guide #{ig}", :red
116
+ say_unless_quiet e.message, :red
117
+ rescue StandardError => e
118
+ say_unless_quiet e.message, :red
95
119
  end
96
120
  end
97
121
 
@@ -0,0 +1,26 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = '<%= library_name %>'
3
+ spec.version = '0.0.1'
4
+ spec.authors = <%= authors %>
5
+ # spec.email = ['TODO']
6
+ spec.date = Time.now.utc.strftime('%Y-%m-%d')
7
+ spec.summary = '<%= title_name %> Test Kit'
8
+ spec.description = '<%= human_name %> Inferno test kit for FHIR'
9
+ # spec.homepage = 'TODO'
10
+ spec.license = 'Apache-2.0'
11
+ spec.add_runtime_dependency 'inferno_core', '~> <%= Inferno::VERSION %>'
12
+ spec.add_development_dependency 'database_cleaner-sequel', '~> 1.8'
13
+ spec.add_development_dependency 'factory_bot', '~> 6.1'
14
+ spec.add_development_dependency 'rspec', '~> 3.10'
15
+ spec.add_development_dependency 'webmock', '~> 3.11'
16
+ spec.required_ruby_version = Gem::Requirement.new('>= 3.1.2')
17
+ # spec.metadata['homepage_uri'] = spec.homepage
18
+ # spec.metadata['source_code_uri'] = 'TODO'
19
+ spec.files = [
20
+ Dir['lib/**/*.rb'],
21
+ Dir['lib/**/*.json'],
22
+ 'LICENSE'
23
+ ].flatten
24
+
25
+ spec.require_paths = ['lib']
26
+ end
@@ -0,0 +1,22 @@
1
+ FROM ruby:3.1.2
2
+
3
+ ENV INSTALL_PATH=/opt/inferno/
4
+ ENV APP_ENV=production
5
+ RUN mkdir -p $INSTALL_PATH
6
+
7
+ WORKDIR $INSTALL_PATH
8
+
9
+ ADD *.gemspec $INSTALL_PATH
10
+ ADD Gemfile* $INSTALL_PATH
11
+ RUN gem install bundler
12
+ # The below RUN line is commented out for development purposes, because any change to the
13
+ # required gems will break the dockerfile build process.
14
+ # If you want to run in Deploy mode, just run `bundle install` locally to update
15
+ # Gemfile.lock, and uncomment the following line.
16
+ # RUN bundle config set --local deployment 'true'
17
+ RUN bundle install
18
+
19
+ ADD . $INSTALL_PATH
20
+
21
+ EXPOSE 4567
22
+ CMD ["bundle", "exec", "puma"]
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gemspec
6
+
7
+ group :development, :test do
8
+ gem 'debug'
9
+ end
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "{}"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright {yyyy} {name of copyright owner}
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,2 @@
1
+ web: bundle exec puma
2
+ worker: bundle exec sidekiq -r ./worker.rb
@@ -0,0 +1,41 @@
1
+ # <%= title_name %> Test Kit
2
+
3
+ <%= human_name %> [Inferno](https://github.com/inferno-community/inferno-core) test kit
4
+ for FHIR testing.
5
+
6
+ ## Documentation
7
+ - [Inferno documentation](https://inferno-framework.github.io/inferno-core/)
8
+ - [Ruby API documentation](https://inferno-framework.github.io/inferno-core/docs)
9
+ - [JSON API documentation](https://inferno-framework.github.io/inferno-core/api-docs)
10
+
11
+ ## Instructions for Developing tests
12
+
13
+ To get started writing tests, click "Use this template" on
14
+ github or use the Ruby-based command: `gem install inferno_core && inferno new my-test-kit`.
15
+ Refer to the Inferno documentation for information about [setting up your development
16
+ environment and running
17
+ Inferno](https://inferno-framework.github.io/inferno-core/getting-started.html#getting-started-for-inferno-test-writers).
18
+
19
+ ## Example Inferno test kits
20
+
21
+ - https://github.com/inferno-community/ips-test-kit
22
+ - https://github.com/inferno-community/shc-vaccination-test-kit
23
+
24
+ ## License
25
+ Copyright <%= Time.now.year %> TODO
26
+
27
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
28
+ this file except in compliance with the License. You may obtain a copy of the
29
+ License at
30
+ ```
31
+ http://www.apache.org/licenses/LICENSE-2.0
32
+ ```
33
+ Unless required by applicable law or agreed to in writing, software distributed
34
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
35
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
36
+ specific language governing permissions and limitations under the License.
37
+
38
+ ## Trademark Notice
39
+
40
+ HL7, FHIR and the FHIR [FLAME DESIGN] are the registered trademarks of Health
41
+ Level Seven International and their use does not constitute endorsement by HL7.
@@ -0,0 +1,15 @@
1
+ begin
2
+ require 'rspec/core/rake_task'
3
+ RSpec::Core::RakeTask.new(:spec)
4
+ task default: :spec
5
+ rescue LoadError # rubocop:disable Lint/SuppressedException
6
+ end
7
+
8
+ namespace :db do
9
+ desc 'Apply changes to the database'
10
+ task :migrate do
11
+ require 'inferno/config/application'
12
+ require 'inferno/utils/migration'
13
+ Inferno::Utils::Migration.new.run
14
+ end
15
+ end
@@ -0,0 +1,18 @@
1
+ development:
2
+ adapter: sqlite
3
+ database: data/inferno_development.db
4
+ max_connections: 10
5
+ # user:
6
+ # password:
7
+ # host:
8
+ # port:
9
+
10
+ production:
11
+ adapter: sqlite
12
+ database: data/inferno_production.db
13
+ max_connections: 10
14
+
15
+ test:
16
+ adapter: sqlite
17
+ database: ':memory:'
18
+ max_connections: 10
@@ -0,0 +1,86 @@
1
+ # this sets the user nginx will run as,
2
+ #and the number of worker processes
3
+ user nobody nogroup;
4
+ worker_processes 2;
5
+ #user www-data;
6
+ #worker_processes auto;
7
+
8
+ # setup where nginx will log errors to
9
+ # and where the nginx process id resides
10
+ error_log /var/log/nginx/error.log;
11
+ pid /var/run/nginx.pid;
12
+
13
+ events {
14
+ worker_connections 1024;
15
+ # set to on if you have more than 1 worker_processes
16
+ accept_mutex on;
17
+ }
18
+
19
+ http {
20
+ include /etc/nginx/mime.types;
21
+
22
+ default_type application/octet-stream;
23
+ access_log /tmp/nginx.access.log combined;
24
+
25
+ # use the kernel sendfile
26
+ # sendfile on; # this causes over-caching because modified timestamps lost in VM
27
+ # prepend http headers before sendfile()
28
+ tcp_nopush on;
29
+
30
+ keepalive_timeout 600;
31
+ tcp_nodelay on;
32
+
33
+ gzip on;
34
+ gzip_vary on;
35
+ gzip_min_length 500;
36
+
37
+ gzip_disable "MSIE [1-6]\.(?!.*SV1)";
38
+ gzip_types text/plain text/xml text/css
39
+ text/comma-separated-values
40
+ text/javascript application/x-javascript
41
+ application/atom+xml image/x-icon;
42
+
43
+ # configure the virtual host
44
+ server {
45
+ # replace with your domain name
46
+ # server_name inferno-server;
47
+
48
+ # port to listen for requests on
49
+ listen 80;
50
+
51
+ # maximum accepted body size of client request
52
+ client_max_body_size 4G;
53
+ # the server will close connections after this time
54
+ keepalive_timeout 600;
55
+
56
+ location /validator {
57
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
58
+ proxy_set_header Host $http_host;
59
+ proxy_set_header X-Forwarded-Proto $scheme;
60
+ proxy_set_header X-Forwarded-Port $server_port;
61
+ proxy_redirect off;
62
+ proxy_set_header Connection '';
63
+ proxy_http_version 1.1;
64
+ chunked_transfer_encoding off;
65
+ proxy_buffering off;
66
+ proxy_cache off;
67
+
68
+ proxy_pass http://fhir_validator_app;
69
+ }
70
+
71
+ location /validatorapi/ {
72
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
73
+ proxy_set_header Host $http_host;
74
+ proxy_set_header X-Forwarded-Proto $scheme;
75
+ proxy_set_header X-Forwarded-Port $server_port;
76
+ proxy_redirect off;
77
+ proxy_set_header Connection '';
78
+ proxy_http_version 1.1;
79
+ chunked_transfer_encoding off;
80
+ proxy_buffering off;
81
+ proxy_cache off;
82
+
83
+ proxy_pass http://validator_service:4567/;
84
+ }
85
+ }
86
+ }
@@ -0,0 +1,101 @@
1
+ # this sets the user nginx will run as,
2
+ #and the number of worker processes
3
+ user nobody nogroup;
4
+ worker_processes 2;
5
+ #user www-data;
6
+ #worker_processes auto;
7
+
8
+ # setup where nginx will log errors to
9
+ # and where the nginx process id resides
10
+ error_log /var/log/nginx/error.log;
11
+ pid /var/run/nginx.pid;
12
+
13
+ events {
14
+ worker_connections 1024;
15
+ # set to on if you have more than 1 worker_processes
16
+ accept_mutex on;
17
+ }
18
+
19
+ http {
20
+ include /etc/nginx/mime.types;
21
+
22
+ default_type application/octet-stream;
23
+ access_log /tmp/nginx.access.log combined;
24
+
25
+ # use the kernel sendfile
26
+ # sendfile on; # this causes over-caching because modified timestamps lost in VM
27
+ # prepend http headers before sendfile()
28
+ tcp_nopush on;
29
+
30
+ keepalive_timeout 600;
31
+ tcp_nodelay on;
32
+
33
+ gzip on;
34
+ gzip_vary on;
35
+ gzip_min_length 500;
36
+
37
+ gzip_disable "MSIE [1-6]\.(?!.*SV1)";
38
+ gzip_types text/plain text/xml text/css
39
+ text/comma-separated-values
40
+ text/javascript application/x-javascript
41
+ application/atom+xml image/x-icon;
42
+
43
+ # configure the virtual host
44
+ server {
45
+ # replace with your domain name
46
+ # server_name inferno-server;
47
+
48
+ # port to listen for requests on
49
+ listen 80;
50
+
51
+ # maximum accepted body size of client request
52
+ client_max_body_size 4G;
53
+ # the server will close connections after this time
54
+ keepalive_timeout 600;
55
+
56
+ location / {
57
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
58
+ proxy_set_header Host $http_host;
59
+ proxy_set_header X-Forwarded-Proto $scheme;
60
+ proxy_set_header X-Forwarded-Port $server_port;
61
+ proxy_redirect off;
62
+ proxy_set_header Connection '';
63
+ proxy_http_version 1.1;
64
+ chunked_transfer_encoding off;
65
+ proxy_buffering off;
66
+ proxy_cache off;
67
+
68
+ proxy_pass http://inferno:4567;
69
+ }
70
+
71
+ location /validator {
72
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
73
+ proxy_set_header Host $http_host;
74
+ proxy_set_header X-Forwarded-Proto $scheme;
75
+ proxy_set_header X-Forwarded-Port $server_port;
76
+ proxy_redirect off;
77
+ proxy_set_header Connection '';
78
+ proxy_http_version 1.1;
79
+ chunked_transfer_encoding off;
80
+ proxy_buffering off;
81
+ proxy_cache off;
82
+
83
+ proxy_pass http://fhir_validator_app;
84
+ }
85
+
86
+ location /validatorapi/ {
87
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
88
+ proxy_set_header Host $http_host;
89
+ proxy_set_header X-Forwarded-Proto $scheme;
90
+ proxy_set_header X-Forwarded-Port $server_port;
91
+ proxy_redirect off;
92
+ proxy_set_header Connection '';
93
+ proxy_http_version 1.1;
94
+ chunked_transfer_encoding off;
95
+ proxy_buffering off;
96
+ proxy_cache off;
97
+
98
+ proxy_pass http://validator_service:4567/;
99
+ }
100
+ }
101
+ }
@@ -0,0 +1,2 @@
1
+ environment ENV.fetch('APP_ENV', 'development')
2
+ port ENV.fetch('INFERNO_PORT', 4567)
@@ -0,0 +1,11 @@
1
+ require 'inferno'
2
+
3
+ use Rack::Static,
4
+ urls: Inferno::Utils::StaticAssets.static_assets_map,
5
+ root: Inferno::Utils::StaticAssets.inferno_path
6
+
7
+ Inferno::Application.finalize!
8
+
9
+ use Inferno::Utils::Middleware::RequestLogger
10
+
11
+ run Inferno::Web.app