blacklight_lando 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -2
- data/README.md +3 -2
- data/lib/blacklight_lando/version.rb +1 -1
- data/lib/blacklight_lando.rb +2 -1
- data/lib/generators/{lando_generator.rb → run_solr.rb} +4 -5
- data/lib/generators/run_solr_and_postgresql.rb +41 -0
- data/lib/generators/templates/.lando_solr_and_postgresql.yml +23 -0
- metadata +6 -4
- /data/lib/generators/templates/{.lando.yml → .lando_solr.yml} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb0adea4f04fee66835a254ccaaaf0bebf71f046e440b3e3aafb0b2c37c36aca
|
4
|
+
data.tar.gz: 5887dacf7183092459c53904a8ffe8e45cda2c20a7c9125102729aace8e0a56d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 299882ca76e0b7c5af762798f8dee3a4e090bba52daa9a6b8d1b529ae9049c0e9b9ff1c27e6a8cff925416afdfbc1315da5d2af389010c8811f86d69e8c2cce9
|
7
|
+
data.tar.gz: 81ca4e608ecd207cf6f1302b692c457017bad092d26062314205d6cb9e465d0b76b5ba6beaf110077af06a45aedf19b4dde9cbea043d80e282fbe88bc3732152
|
data/CHANGELOG.md
CHANGED
@@ -4,5 +4,11 @@
|
|
4
4
|
|
5
5
|
- Initial release
|
6
6
|
|
7
|
-
## [0.2.0] - 2024-02-
|
8
|
-
- Add postgresql
|
7
|
+
## [0.2.0] - 2024-02-26
|
8
|
+
- Add postgresql
|
9
|
+
|
10
|
+
## [0.2.1] - 2024-02-27
|
11
|
+
- Add pg gem to Gemfile
|
12
|
+
|
13
|
+
## [0.3.0] - 2024-02-28
|
14
|
+
- Split the generators into a solr-only one and a solr and postgresql one. The Postgresql generator isn't working properly, so I need to use the solr-only one for a workshop.
|
data/README.md
CHANGED
@@ -9,13 +9,14 @@ This gem creates a [Lando](https://lando.dev/) config file for running [Solr](ht
|
|
9
9
|
## Installation
|
10
10
|
1. Add this gem to the `Gemfile` of your Blacklight application:
|
11
11
|
```
|
12
|
-
gem "blacklight_lando", "~> 0.
|
12
|
+
gem "blacklight_lando", "~> 0.3"
|
13
13
|
```
|
14
14
|
2. Run `bundle install`
|
15
|
-
3. Run `rails generate blacklight_lando:
|
15
|
+
3. Run `rails generate blacklight_lando:run_solr`
|
16
16
|
4. Start lando: `lando start`
|
17
17
|
5. Start blacklight as normal: `bundle exec rails s`
|
18
18
|
|
19
|
+
Your application should now be running against the instance of solr that lando is running in a docker container.
|
19
20
|
|
20
21
|
## Usage
|
21
22
|
|
data/lib/blacklight_lando.rb
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative "blacklight_lando/version"
|
4
|
-
require_relative "generators/
|
4
|
+
require_relative "generators/run_solr"
|
5
|
+
require_relative "generators/run_solr_and_postgresql"
|
5
6
|
|
6
7
|
# Configure a Blacklight application to use Lando for Solr and Postresql
|
7
8
|
module BlacklightLando
|
@@ -2,8 +2,9 @@
|
|
2
2
|
|
3
3
|
require "rails/generators"
|
4
4
|
module BlacklightLando
|
5
|
-
# Generator for adding lando to a blacklight application
|
6
|
-
|
5
|
+
# Generator for adding lando to a blacklight application and
|
6
|
+
# configuring it to use Solr
|
7
|
+
class RunSolr < Rails::Generators::Base
|
7
8
|
source_root ::File.expand_path("templates", __dir__)
|
8
9
|
|
9
10
|
# rubocop:disable Naming/HeredocDelimiterNaming
|
@@ -12,15 +13,13 @@ module BlacklightLando
|
|
12
13
|
1. Adds .lando.yml to your application
|
13
14
|
2. Adds lando_env.rb to your application and includes it in application.rb
|
14
15
|
3. Copies lando-configured config/blacklight.yml into your application
|
15
|
-
4. Copies lando-configured config/database.yml into your application
|
16
16
|
EOF
|
17
17
|
# rubocop:enable Naming/HeredocDelimiterNaming
|
18
18
|
|
19
19
|
def create_lando_config
|
20
|
-
copy_file ".lando.yml"
|
20
|
+
copy_file ".lando_solr.yml", ".lando.yml"
|
21
21
|
copy_file "lando_env.rb", "config/initializers/lando_env.rb"
|
22
22
|
copy_file "blacklight.yml", "config/blacklight.yml"
|
23
|
-
copy_file "database.yml", "config/database.yml"
|
24
23
|
end
|
25
24
|
end
|
26
25
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators"
|
4
|
+
module BlacklightLando
|
5
|
+
# Generator for adding lando to a blacklight application
|
6
|
+
class RunSolrAndPostgresql < Rails::Generators::Base
|
7
|
+
source_root ::File.expand_path("templates", __dir__)
|
8
|
+
|
9
|
+
# rubocop:disable Naming/HeredocDelimiterNaming
|
10
|
+
desc <<-EOF
|
11
|
+
This generator makes the following changes to your application:
|
12
|
+
1. Adds .lando.yml to your application
|
13
|
+
2. Adds lando_env.rb to your application and includes it in application.rb
|
14
|
+
3. Copies lando-configured config/blacklight.yml into your application
|
15
|
+
4. Copies lando-configured config/database.yml into your application
|
16
|
+
EOF
|
17
|
+
# rubocop:enable Naming/HeredocDelimiterNaming
|
18
|
+
|
19
|
+
# Add postgres gem to Gemfile
|
20
|
+
def add_pg_gem
|
21
|
+
gem "pg"
|
22
|
+
end
|
23
|
+
|
24
|
+
def bundle_install
|
25
|
+
return if Rails.env.test?
|
26
|
+
|
27
|
+
inside destination_root do
|
28
|
+
Bundler.with_unbundled_env do
|
29
|
+
run "bundle install"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
def create_lando_config
|
35
|
+
copy_file ".lando_solr_and_postgresql.yml", ".lando.yml"
|
36
|
+
copy_file "lando_env.rb", "config/initializers/lando_env.rb"
|
37
|
+
copy_file "blacklight.yml", "config/blacklight.yml"
|
38
|
+
copy_file "database.yml", "config/database.yml"
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
---
|
2
|
+
name: blacklight
|
3
|
+
services:
|
4
|
+
test_solr:
|
5
|
+
type: solr:8.4
|
6
|
+
portforward: true
|
7
|
+
core: blacklight-core-test
|
8
|
+
config:
|
9
|
+
dir: "solr/conf"
|
10
|
+
development_solr:
|
11
|
+
type: solr:8.4
|
12
|
+
portforward: true
|
13
|
+
core: blacklight-core-dev
|
14
|
+
config:
|
15
|
+
dir: "solr/conf"
|
16
|
+
database:
|
17
|
+
type: postgres:15
|
18
|
+
portforward: true
|
19
|
+
proxy:
|
20
|
+
test_solr:
|
21
|
+
- blacklight.test.solr.lndo.site:8983
|
22
|
+
development_solr:
|
23
|
+
- blacklight.dev.solr.lndo.site:8983
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blacklight_lando
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bess Sadler
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-02-
|
11
|
+
date: 2024-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
@@ -99,8 +99,10 @@ files:
|
|
99
99
|
- Rakefile
|
100
100
|
- lib/blacklight_lando.rb
|
101
101
|
- lib/blacklight_lando/version.rb
|
102
|
-
- lib/generators/
|
103
|
-
- lib/generators/
|
102
|
+
- lib/generators/run_solr.rb
|
103
|
+
- lib/generators/run_solr_and_postgresql.rb
|
104
|
+
- lib/generators/templates/.lando_solr.yml
|
105
|
+
- lib/generators/templates/.lando_solr_and_postgresql.yml
|
104
106
|
- lib/generators/templates/blacklight.yml
|
105
107
|
- lib/generators/templates/database.yml
|
106
108
|
- lib/generators/templates/lando_env.rb
|
File without changes
|