record_loader 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +1 -1
- data/README.md +33 -0
- data/Rakefile +6 -2
- data/lib/generators/record_loader/static_files/record_loader.rake +6 -0
- data/lib/generators/record_loader/templates/config/{record_loader → default_records}/%underscores%/default_records.yml +0 -0
- data/lib/record_loader/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f743ea558870c1ddea1c262a64381725c6361f7a340cebc9bcff77e36a631ed
|
4
|
+
data.tar.gz: 40f7875e4cad259176da0f1b88591b5ac4934d07491db655d014a05098b3ad1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80b92f4b9ab83a6a46a7a363ed2e0205904bf6c10239566beeb04ee21152fc0ab809cb93fe9a22b019781a260a0cbec19fae8e7054f1011d700525ecb1b3c225
|
7
|
+
data.tar.gz: e834371ac808b6bad18f6f3708d9e0752a18419367260b6a182b31b88f2780b118fab20f03512c55d7e2a6a1acf2abb41fa5a2647002c1e8eae9c3e923d5a7e7
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,13 @@ Unreleased section to make new releases easy.
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [0.1.1]
|
9
|
+
|
10
|
+
- [Fixed] Preflight task on `rake release` now run prior to release.
|
11
|
+
- [Fixed] Generators place config files in correct directory
|
12
|
+
- [Documentation] Improved documentation regarding dependencies
|
13
|
+
- [Documentation] Improved documentation regarding deployment
|
14
|
+
|
8
15
|
## [0.1.0]
|
9
16
|
|
10
17
|
Initial release
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -154,6 +154,39 @@ If you have an existing feature flag system you can use this instead by adding a
|
|
154
154
|
end
|
155
155
|
```
|
156
156
|
|
157
|
+
## RecordLoader Dependencies
|
158
|
+
|
159
|
+
Sometimes one loader will be dependent on the output of another. If this is the case, you can simply configure
|
160
|
+
its rake task to use the other as a pre-requisite.
|
161
|
+
|
162
|
+
For example
|
163
|
+
|
164
|
+
```ruby
|
165
|
+
namespace :record_loader do
|
166
|
+
desc 'Automatically generate Dependent through DependentLoader'
|
167
|
+
task dependent: [:environment, :prerequisite] do
|
168
|
+
RecordLoader::DependentLoader.new.create!
|
169
|
+
end
|
170
|
+
end
|
171
|
+
```
|
172
|
+
|
173
|
+
## Triggering on deployment
|
174
|
+
|
175
|
+
It can be useful to set `rake record_loader:all` to run automatically on deployment.
|
176
|
+
It is recommend you trigger this after migrations have run.
|
177
|
+
|
178
|
+
### Within Sanger PSD
|
179
|
+
|
180
|
+
**This section is relevant to developers within the Sanger only. Other users of the Gem should hook into their own deployment systems as they see fit.**
|
181
|
+
|
182
|
+
In Production Software Development at the Sanger we have the Ansible deployment project configured to run
|
183
|
+
`rake application:post_deploy` after migrations for selected applications. If you wish to take advantage of this
|
184
|
+
uncomment the appropriate line in `lib/tasks/record_loader.rake`. You should also ensure that your application has
|
185
|
+
the post_deploy tasks enabled by setting the post_deploy to true for your application.
|
186
|
+
|
187
|
+
Currently this behaviour is configured as part of the 'rails' role, and will need to be set-up independently for
|
188
|
+
any non-Rails ruby applications.
|
189
|
+
|
157
190
|
## Non Rails Environments
|
158
191
|
|
159
192
|
In non-rails environments you can use the {RecordLoader::Adapter::Basic} adapter to avoid Rails specific functionality.
|
data/Rakefile
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# We add preflight to the release task pre-requisites before loading in the
|
4
|
+
# bundler/gem_tasks to ensure that it runs first. This is becuase 'release' is
|
5
|
+
# actually composed entirely of pre-requisites and so would otherwise end up
|
6
|
+
# running the pre-flight tasks AFTER everything else
|
7
|
+
task release: :preflight
|
8
|
+
|
3
9
|
require 'bundler/gem_tasks'
|
4
10
|
require 'rspec/core/rake_task'
|
5
11
|
require 'rubocop/rake_task'
|
@@ -9,8 +15,6 @@ RuboCop::RakeTask.new
|
|
9
15
|
|
10
16
|
task default: %i[rubocop spec]
|
11
17
|
|
12
|
-
task release: :preflight
|
13
|
-
|
14
18
|
desc 'Runs the preflight checklist before building a release'
|
15
19
|
task :preflight do
|
16
20
|
puts '🛫 Preflight checklist'
|
@@ -9,3 +9,9 @@ namespace :record_loader do
|
|
9
9
|
puts 'Loading all records'
|
10
10
|
end
|
11
11
|
end
|
12
|
+
|
13
|
+
# In Sanger PSD we have the ansible deployment project configured to run `rake application:post_deploy` after migrations
|
14
|
+
# for selected applications.
|
15
|
+
# Uncomment the following to automatically trigger record loader on running the application:post_deploy task.
|
16
|
+
# You may need to set `post_deploy: true` in the ansible configuration for your application.
|
17
|
+
# task 'application:post_deploy' => 'record_loader:all'
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: record_loader
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Glover
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-05-
|
11
|
+
date: 2020-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -150,7 +150,7 @@ files:
|
|
150
150
|
- lib/generators/record_loader/record_loader_generator.rb
|
151
151
|
- lib/generators/record_loader/static_files/application_record_loader.rb
|
152
152
|
- lib/generators/record_loader/static_files/record_loader.rake
|
153
|
-
- lib/generators/record_loader/templates/config/
|
153
|
+
- lib/generators/record_loader/templates/config/default_records/%underscores%/default_records.yml
|
154
154
|
- lib/generators/record_loader/templates/lib/record_loader/%underscore_loader%.rb.tt
|
155
155
|
- lib/generators/record_loader/templates/lib/tasks/record_loader/%underscore%.rake.tt
|
156
156
|
- lib/generators/record_loader/templates/spec/data/record_loader/%underscores%/two_entry_example.yml
|
@@ -185,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
185
185
|
- !ruby/object:Gem::Version
|
186
186
|
version: '0'
|
187
187
|
requirements: []
|
188
|
-
rubygems_version: 3.0.
|
188
|
+
rubygems_version: 3.0.8
|
189
189
|
signing_key:
|
190
190
|
specification_version: 4
|
191
191
|
summary: Easily manage seeding and updating data from simple yml files
|