blacklight_lando 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +1 -1
- data/lib/blacklight_lando/version.rb +1 -1
- data/lib/blacklight_lando.rb +5 -0
- data/lib/generators/lando_generator.rb +3 -1
- data/lib/generators/templates/.lando.yml +4 -1
- data/lib/generators/templates/blacklight.yml +13 -0
- data/lib/generators/templates/database.yml +26 -0
- data/lib/generators/templates/lando_env.rb +7 -1
- metadata +4 -5
- data/.byebug_history +0 -22
- data/.lando.yml +0 -20
- data/config/lando_env.rb +0 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3c3933b2aec55e04f6d9c426fb2bddda7ac1abe6d0b387a9809eb2d7043accf
|
4
|
+
data.tar.gz: b2650017b1fd50f106129c760558d4c76383af3b5dcc57f31f8d4f0246ea8fe8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2a926212e829cd7c85429408d3ce1c15278330120962de68917c1e8836c714435a7b47ff5c7f20f940e006dcd2e33415e0b3a4bfd2bcb00297e2bbb235f7575f
|
7
|
+
data.tar.gz: 5a005880f8814bb18b7bbf3469ea4fbb512edb6141914566c685b21f6220c229bdce2d706cf125424d42dc11a8bf4697493e6e5dd21514699ff9888fe9a94e51
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ 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.2"
|
13
13
|
```
|
14
14
|
2. Run `bundle install`
|
15
15
|
3. Run `rails generate blacklight_lando:lando`
|
data/lib/blacklight_lando.rb
CHANGED
@@ -3,6 +3,11 @@
|
|
3
3
|
require_relative "blacklight_lando/version"
|
4
4
|
require_relative "generators/lando_generator"
|
5
5
|
|
6
|
+
# Configure a Blacklight application to use Lando for Solr and Postresql
|
6
7
|
module BlacklightLando
|
7
8
|
class Error < StandardError; end
|
9
|
+
|
10
|
+
def self.root
|
11
|
+
File.dirname __dir__
|
12
|
+
end
|
8
13
|
end
|
@@ -12,13 +12,15 @@ module BlacklightLando
|
|
12
12
|
1. Adds .lando.yml to your application
|
13
13
|
2. Adds lando_env.rb to your application and includes it in application.rb
|
14
14
|
3. Copies lando-configured config/blacklight.yml into your application
|
15
|
-
4.
|
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
20
|
copy_file ".lando.yml"
|
21
21
|
copy_file "lando_env.rb", "config/initializers/lando_env.rb"
|
22
|
+
copy_file "blacklight.yml", "config/blacklight.yml"
|
23
|
+
copy_file "database.yml", "config/database.yml"
|
22
24
|
end
|
23
25
|
end
|
24
26
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
---
|
2
|
-
name:
|
2
|
+
name: blacklight
|
3
3
|
services:
|
4
4
|
test_solr:
|
5
5
|
type: solr:8.4
|
@@ -13,6 +13,9 @@ services:
|
|
13
13
|
core: blacklight-core-dev
|
14
14
|
config:
|
15
15
|
dir: "solr/conf"
|
16
|
+
database:
|
17
|
+
type: postgres:15
|
18
|
+
portforward: true
|
16
19
|
proxy:
|
17
20
|
test_solr:
|
18
21
|
- blacklight.test.solr.lndo.site:8983
|
@@ -0,0 +1,13 @@
|
|
1
|
+
load_defaults: 7.19.2
|
2
|
+
development:
|
3
|
+
adapter: solr
|
4
|
+
url: <%= ENV['SOLR_URL'] || ENV['lando_development_solr'] %>
|
5
|
+
test: &test
|
6
|
+
adapter: solr
|
7
|
+
url: <%= ENV['SOLR_URL'] || ENV['lando_test_solr'] %>
|
8
|
+
production:
|
9
|
+
adapter: solr
|
10
|
+
url: <%= ENV['SOLR_URL'] %>
|
11
|
+
staging:
|
12
|
+
adapter: solr
|
13
|
+
url: <%= ENV['SOLR_URL'] %>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
default: &default
|
2
|
+
adapter: postgresql
|
3
|
+
encoding: utf8
|
4
|
+
min_messages: warning
|
5
|
+
pool: <%= Integer(ENV.fetch("DB_POOL", 40)) %>
|
6
|
+
reaping_frequency: <%= Integer(ENV.fetch("DB_REAPING_FREQUENCY", 10)) %>
|
7
|
+
timeout: 5000
|
8
|
+
host: <%= ENV["lando_database_conn_host"] || ENV["APP_DB_HOST"] || "localhost" %>
|
9
|
+
port: <%= ENV["lando_database_conn_port"] || 5432 %>
|
10
|
+
username: <%= ENV["lando_database_creds_user"] || ENV["APP_DB_USERNAME"] %>
|
11
|
+
password: <%= ENV["lando_database_creds_password"] || ENV["APP_DB_PASSWORD"] %>
|
12
|
+
database: <%= ENV['APP_DB'] %>
|
13
|
+
|
14
|
+
development:
|
15
|
+
<<: *default
|
16
|
+
database: <%= ENV["lando_database_creds_database"] || ENV["APP_DB"] %>
|
17
|
+
|
18
|
+
test:
|
19
|
+
<<: *default
|
20
|
+
database: <%= ENV["lando_database_creds_database"] || ENV["APP_DB"] %>
|
21
|
+
|
22
|
+
production:
|
23
|
+
<<: *default
|
24
|
+
|
25
|
+
staging:
|
26
|
+
<<: *default
|
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
if Rails.env.development? || Rails.env.test?
|
4
4
|
begin
|
5
|
-
|
5
|
+
lando_info = `lando info --format json`
|
6
|
+
lando_services = JSON.parse(lando_info, symbolize_names: true)
|
6
7
|
lando_services.each do |service|
|
7
8
|
case service[:service]
|
8
9
|
when "test_solr"
|
@@ -10,6 +11,11 @@ if Rails.env.development? || Rails.env.test?
|
|
10
11
|
when "development_solr"
|
11
12
|
ENV["lando_development_solr"] = "http://#{service[:external_connection][:host]}:#{service[:external_connection][:port]}/solr/#{service[:core]}"
|
12
13
|
end
|
14
|
+
next unless service[:creds]
|
15
|
+
|
16
|
+
service[:creds].each do |key, value|
|
17
|
+
ENV["lando_#{service[:service]}_creds_#{key}"] = value
|
18
|
+
end
|
13
19
|
end
|
14
20
|
rescue StandardError
|
15
21
|
nil
|
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.2.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-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blacklight
|
@@ -90,8 +90,6 @@ executables: []
|
|
90
90
|
extensions: []
|
91
91
|
extra_rdoc_files: []
|
92
92
|
files:
|
93
|
-
- ".byebug_history"
|
94
|
-
- ".lando.yml"
|
95
93
|
- ".rspec"
|
96
94
|
- ".rubocop.yml"
|
97
95
|
- CHANGELOG.md
|
@@ -99,11 +97,12 @@ files:
|
|
99
97
|
- LICENSE
|
100
98
|
- README.md
|
101
99
|
- Rakefile
|
102
|
-
- config/lando_env.rb
|
103
100
|
- lib/blacklight_lando.rb
|
104
101
|
- lib/blacklight_lando/version.rb
|
105
102
|
- lib/generators/lando_generator.rb
|
106
103
|
- lib/generators/templates/.lando.yml
|
104
|
+
- lib/generators/templates/blacklight.yml
|
105
|
+
- lib/generators/templates/database.yml
|
107
106
|
- lib/generators/templates/lando_env.rb
|
108
107
|
- sig/blacklight_lando.rbs
|
109
108
|
homepage: https://github.com/bess/blacklight_lando
|
data/.byebug_history
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
n
|
2
|
-
fixture_file_destination
|
3
|
-
fixture_file
|
4
|
-
exit
|
5
|
-
generator.generate
|
6
|
-
generator.shell.destination_stack
|
7
|
-
generator.shell
|
8
|
-
generator.shell.base.destination_stack
|
9
|
-
generator.shell.base
|
10
|
-
generator.shell.public_methods - Object.methods
|
11
|
-
generator.shell
|
12
|
-
generator.shell.destination_stack
|
13
|
-
generator.shell
|
14
|
-
generator.options
|
15
|
-
generator
|
16
|
-
generator.base
|
17
|
-
generator
|
18
|
-
generator.destination_stack
|
19
|
-
generator
|
20
|
-
exit
|
21
|
-
BlacklightLando::LandoGenerator.generate
|
22
|
-
BlacklightLando::LandoGenerator
|
data/.lando.yml
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
---
|
2
|
-
name: search_app
|
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
|
-
proxy:
|
17
|
-
test_solr:
|
18
|
-
- blacklight.test.solr.lndo.site:8983
|
19
|
-
development_solr:
|
20
|
-
- blacklight.dev.solr.lndo.site:8983
|
data/config/lando_env.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
if Rails.env.development? || Rails.env.test?
|
4
|
-
begin
|
5
|
-
lando_services = JSON.parse(`lando info --format json`, symbolize_names: true)
|
6
|
-
lando_services.each do |service|
|
7
|
-
case service[:service]
|
8
|
-
when "test_solr"
|
9
|
-
ENV["lando_test_solr"] = "http://#{service[:external_connection][:host]}:#{service[:external_connection][:port]}/solr/#{service[:core]}"
|
10
|
-
when "development_solr"
|
11
|
-
ENV["lando_development_solr"] = "http://#{service[:external_connection][:host]}:#{service[:external_connection][:port]}/solr/#{service[:core]}"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
rescue StandardError
|
15
|
-
nil
|
16
|
-
end
|
17
|
-
end
|