geoblacklight 5.1.0 → 5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3a533a2028cc4a5d4edc6aba0c532812d5266ce7e94fc290208f0ea26216056
4
- data.tar.gz: 4644a2f7c1cae18643207a99c2d7cdbde53a1b27c521a6a94a1e1ff6a7c37e15
3
+ metadata.gz: 32b1f6b2ee7ddbd7ba16adc14ddad99cb87a9294004dfe7337ed0084626d1202
4
+ data.tar.gz: 3dfb956c7f0f3236671a65d9b3b8aea8135f473a388236b8879b0fdca064e310
5
5
  SHA512:
6
- metadata.gz: 404ed2e84916e9505a22e08979e569b301fb1dbf620d72d1c015e0f49f106183bbc2757d649a7ab3392fe9bec8cdefbe735d0a3ec9ea8b96909b4e5b10267bd2
7
- data.tar.gz: 82e33f34850832707b5259c9f356ca5858446474b44672357f05495b517c4bbdd539ff330c557ac143422baf0c7377c4e0ca6dc758be73cce8a7d4b939c2be72
6
+ metadata.gz: a8f1c491b83df2cf7c3ca22b8239c718697eb9e9aa3596255e2bd2c6b59ee85d79ee04bbc70c8fac9fe9bd20f9d9ed56519184898d4e6bfa21adc3a2b7261728
7
+ data.tar.gz: 24f5d3148d558ffe6a2c8845419228bc51bf64d7277fa1ae7aad8e920341851cf02a91cb699cc7080dd7a27ea6c62d415d91620b0744b92bd9d8148cbe917362
@@ -0,0 +1,15 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "github-actions"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
12
+ - package-ecosystem: "npm"
13
+ directory: "/"
14
+ schedule:
15
+ interval: "weekly"
@@ -10,7 +10,7 @@ jobs:
10
10
  linter:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v4
13
+ - uses: actions/checkout@v6
14
14
  - name: Set up Ruby
15
15
  uses: ruby/setup-ruby@v1
16
16
  with:
@@ -23,7 +23,7 @@ jobs:
23
23
  aardvark-fixture-linter:
24
24
  runs-on: ubuntu-latest
25
25
  steps:
26
- - uses: actions/checkout@v4
26
+ - uses: actions/checkout@v6
27
27
  - name: Set up Ruby
28
28
  uses: ruby/setup-ruby@v1
29
29
  with:
@@ -38,13 +38,18 @@ jobs:
38
38
  strategy:
39
39
  matrix:
40
40
  ruby_version: ["3.2", "3.3", "3.4"]
41
- rails_version: ["7.1.5.1", "7.2.2.1", "8.0.1"]
41
+ rails_version: ["7.2.3", "8.1.1"]
42
42
  asset_pipeline: ["vite"]
43
43
  additional_engine_cart_rails_options: ["--js rollup"]
44
+ include:
45
+ - ruby_version: "3.4"
46
+ rails_version: "8.1.1"
47
+ asset_pipeline: "importmap"
48
+ additional_engine_cart_rails_options: "--js importmap"
44
49
 
45
50
  name: test ruby ${{ matrix.ruby_version }} / rails ${{ matrix.rails_version }} / ${{ matrix.asset_pipeline }}
46
51
  steps:
47
- - uses: actions/checkout@v4
52
+ - uses: actions/checkout@v6
48
53
  - name: Set up Ruby
49
54
  uses: ruby/setup-ruby@v1
50
55
  with:
@@ -67,8 +72,8 @@ jobs:
67
72
  ENGINE_CART_RAILS_OPTIONS: "--skip-docker --skip-action-cable --skip-rubocop --skip-brakeman --skip-kamal --skip-solid -a propshaft --css bootstrap ${{ matrix.additional_engine_cart_rails_options }}"
68
73
  SOLR_URL: http://solr:SolrRocks@localhost:8983/solr/blacklight-core
69
74
  - name: Upload coverage artifacts
70
- uses: actions/upload-artifact@v4
71
- if: always()
75
+ uses: actions/upload-artifact@v6
76
+ if: matrix.asset_pipeline == 'vite'
72
77
  with:
73
78
  name: "coverage-${{ matrix.ruby_version }}-${{ matrix.rails_version }}"
74
79
  path: coverage/
@@ -2,7 +2,7 @@
2
2
 
3
3
  class RelationController < ApplicationController
4
4
  include Blacklight::Configurable
5
- # include Blacklight::SearchHelper
5
+
6
6
  copy_blacklight_config_from(CatalogController)
7
7
 
8
8
  def index
@@ -48,8 +48,8 @@ export default class extends Controller {
48
48
  renderMessage(message) {
49
49
  Object.entries(message).forEach(([idx, msg]) => {
50
50
  const flash = document.createElement("div");
51
- flash.className = `alert alert-${msg[0]}`;
52
- flash.innerHTML = `<button type="button" class="close" data-bs-dismiss="alert" aria-hidden="true">&times;</button>${msg[1]}`;
51
+ flash.className = `alert alert-${msg[0]} alert-dismissible fade show`;
52
+ flash.innerHTML = `${msg[1]}<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>`;
53
53
  document.querySelector("div.flash_messages").appendChild(flash);
54
54
  });
55
55
  }
@@ -21,10 +21,9 @@ module Geoblacklight
21
21
  delivered via CDN.
22
22
  DESCRIPTION
23
23
 
24
- # If this is a local dev/test build, symlink the frontend package so we
25
- # can reference its stylesheets in development
26
- def link_frontend
27
- run "yarn link @geoblacklight/frontend" if options[:test]
24
+ # Switch bootstrap import to ESM version so we can import individual parts
25
+ def use_bootstrap_esm
26
+ gsub_file "config/importmap.rb", /dist\/js\/bootstrap\.js/, "dist/js/bootstrap.esm.js"
28
27
  end
29
28
 
30
29
  # Add the customization overrides and insert before bootstrap import
@@ -62,17 +61,6 @@ module Geoblacklight
62
61
  append_to_file "app/javascript/application.js", "import Geoblacklight from \"geoblacklight\";"
63
62
  end
64
63
 
65
- # Add pins for application dependencies to the importmap
66
- def update_importmap
67
- gsub_file "config/importmap.rb", "bootstrap.min.js", "https://cdn.skypack.dev/bootstrap@5.3.3"
68
- append_to_file "config/importmap.rb" do
69
- <<~CONTENT
70
- pin "@github/auto-complete-element", to: "https://cdn.skypack.dev/@github/auto-complete-element"
71
- pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/core@2.11.8/dist/umd/popper.min.js"
72
- CONTENT
73
- end
74
- end
75
-
76
64
  # Run the build so styles are available for the first load of the app
77
65
  def build_styles
78
66
  run "yarn build:css"
@@ -42,23 +42,13 @@ module Geoblacklight
42
42
  run "bundle exec vite install"
43
43
  end
44
44
 
45
- # Pick a version of the frontend asset package and install it.
46
- def add_frontend
47
- # If a branch was specified (e.g. you are running a template.rb build
48
- # against a test branch), use the latest version available on npm
49
- if ENV["BRANCH"]
50
- run "yarn add @geoblacklight/frontend@latest"
51
-
52
- # Otherwise, pick the version from npm that matches our Geoblacklight
53
- # gem version
54
- else
55
- run "yarn add @geoblacklight/frontend@#{Geoblacklight::VERSION}"
45
+ # The vite-plugin-ruby package has a breaking change in 5.1.2,
46
+ # so we need to resolve to a specific version to avoid issues.
47
+ # Remove after https://github.com/ElMassimo/vite_ruby/issues/586 is fixed.
48
+ def pin_vite_plugin_ruby
49
+ inject_into_file "package.json", before: " \"dependencies\": {" do
50
+ " \"resolutions\": { \"vite-plugin-ruby\": \"5.1.1\" },\n"
56
51
  end
57
-
58
- # If in local development or CI, also create a link. This will make it so
59
- # changes made in the outer directory are picked up automatically.
60
- # `yarn link` has to have already been run in the outer directory first.
61
- run "yarn link @geoblacklight/frontend" if options[:test]
62
52
  end
63
53
 
64
54
  # The vite_rails gem doesn't currently install the vite-plugin-rails
@@ -7,6 +7,21 @@ module Geoblacklight
7
7
  class_option :"asset-pipeline", type: :string, default: ENV.fetch("ASSET_PIPELINE", "vite"), desc: "Choose the asset pipeline to use (vite or importmap)"
8
8
  class_option :test, type: :boolean, default: ENV.fetch("CI", false), aliases: "-t", desc: "Indicates that app will be installed in a test environment"
9
9
 
10
+ # Pick a version of the frontend asset package and install it.
11
+ #
12
+ # If a branch was specified (e.g. you are running a template.rb build
13
+ # against a test branch), use the latest version available on npm.
14
+ #
15
+ # Otherwise, pick the version from npm that matches our Geoblacklight
16
+ # gem version.
17
+ def add_frontend
18
+ if ENV["BRANCH"]
19
+ run "yarn add @geoblacklight/frontend@latest"
20
+ else
21
+ run "yarn add @geoblacklight/frontend@#{Geoblacklight::VERSION}"
22
+ end
23
+ end
24
+
10
25
  def run_asset_pipeline_specific_generator
11
26
  generated_options = "--test=true" if options[:test]
12
27
  generator = if options[:"asset-pipeline"]
@@ -1,5 +1,5 @@
1
1
  # ArcGIS Online Base URL
2
- ARCGIS_BASE_URL: 'https://www.arcgis.com/home/webmap/viewer.html'
2
+ ARCGIS_BASE_URL: 'https://www.arcgis.com/apps/mapviewer/index.html'
3
3
 
4
4
  # Download path can be configured using this setting
5
5
  #DOWNLOAD_PATH: "./tmp/cache/downloads"
@@ -14,7 +14,7 @@ module Geoblacklight
14
14
  request_params = GEOJSON_DOWNLOAD_PARAMS.merge(typeName: document.wxs_identifier)
15
15
  super(document, {
16
16
  type: "geojson",
17
- extension: "json",
17
+ extension: "geojson",
18
18
  request_params: request_params,
19
19
  content_type: "application/json",
20
20
  service_type: "wfs"
@@ -32,7 +32,7 @@ module Geoblacklight
32
32
  next unless app.config.respond_to?(:importmap) # skip for Vite
33
33
 
34
34
  app.config.importmap.paths << Engine.root.join("config/importmap.rb")
35
- app.config.importmap.cache_sweepers << Engine.root.join("app/assets/javascripts")
35
+ app.config.importmap.cache_sweepers << Engine.root.join("app/javascript")
36
36
  end
37
37
  end
38
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Geoblacklight
4
- VERSION = "5.1.0"
4
+ VERSION = "5.2.0"
5
5
  end
@@ -13,6 +13,7 @@ end
13
13
  def with_solr(&block)
14
14
  puts "Starting Solr"
15
15
  system_with_error_handling "docker compose up -d solr"
16
+ sleep 5 # give solr a few seconds to load the core config and be ready
16
17
  yield
17
18
  ensure
18
19
  puts "Stopping Solr"
@@ -23,7 +24,7 @@ namespace :geoblacklight do
23
24
  desc "Run Solr and GeoBlacklight for interactive development"
24
25
  task :server, [:rails_server_args] do |_t, args|
25
26
  with_solr do
26
- Rake::Task["geoblacklight:internal:seed"].invoke
27
+ Rake::Task["geoblacklight:index:seed"].invoke
27
28
 
28
29
  puts "Starting GeoBlacklight (Rails server)"
29
30
  puts " "
@@ -35,26 +36,15 @@ namespace :geoblacklight do
35
36
  end
36
37
  end
37
38
 
38
- # Local fixtures: bundle exec rake "geoblacklight:index:seed"
39
- # Remote fixtures: bundle exec rake "geoblacklight:index:seed[:remote]"
39
+ # Get fixture items bundled with the gem and index them into Solr
40
40
  namespace :index do
41
41
  desc "Index GBL test fixture metadata into Solr"
42
- task :seed, [:remote] => :environment do |t, args|
43
- docs = []
42
+ task seed: :environment do
43
+ puts "Indexing test fixtures"
44
44
 
45
- if args.remote
46
- puts "Indexing - Remote test fixtures"
47
- JSON.parse(
48
- URI.parse("https://api.github.com/repos/geoblacklight/geoblacklight/contents/spec/fixtures/solr_documents").open.read
49
- ).each do |fixture|
50
- if fixture["name"].include?(".json")
51
- docs << JSON.parse(URI.parse(fixture["download_url"]).open.read)
52
- end
53
- end
54
- else
55
- puts "Indexing - Local test fixtures"
56
- docs = Dir["spec/fixtures/solr_documents/*.json"].map { |f| JSON.parse File.read(f) }.flatten
57
- end
45
+ gem_path = Gem::Specification.find_by_name("geoblacklight").gem_dir
46
+ fixtures_path = File.join(gem_path, "spec", "fixtures", "solr_documents", "*.json")
47
+ docs = Dir[fixtures_path].flat_map { |f| JSON.parse(File.read(f)) }
58
48
 
59
49
  Blacklight.default_index.connection.add docs
60
50
  Blacklight.default_index.connection.commit
@@ -71,19 +61,21 @@ namespace :geoblacklight do
71
61
  FileUtils.mkdir_p(Rails.root.join("tmp", "cache", "downloads"), verbose: true)
72
62
  end
73
63
  desc "Precaches a download"
74
- task :precache, [:doc_id, :download_type, :timeout] => [:environment] do |_t, args|
64
+ task :precache, %i[doc_id download_type timeout] => [:environment] do |_t, args|
75
65
  unless args[:doc_id] && args[:download_type] && args[:timeout]
76
- fail "Please supply required arguments [document_id, download_type and timeout]"
66
+ raise "Please supply required arguments [document_id, download_type and timeout]"
77
67
  end
68
+
78
69
  document = Geoblacklight::SolrDocument.find(args[:doc_id])
79
- fail Blacklight::Exceptions::RecordNotFound if document[:id] != args[:doc_id]
70
+ raise Blacklight::Exceptions::RecordNotFound if document[:id] != args[:doc_id]
71
+
80
72
  download = "Geoblacklight::#{args[:download_type].capitalize}Download"
81
73
  .constantize.new(document, timeout: args[:timeout].to_i)
82
74
  download.get
83
75
  Rails.logger.info "Successfully downloaded #{download.file_name}"
84
76
  Rails.logger.info Geoblacklight::ShapefileDownload.file_path.to_s
85
- rescue Geoblacklight::Exceptions::ExternalDownloadFailed => error
86
- Rails.logger.error error.message + " " + error.url
77
+ rescue Geoblacklight::Exceptions::ExternalDownloadFailed => e
78
+ Rails.logger.error e.message + " " + e.url
87
79
  rescue NameError
88
80
  Rails.logger.error "Could not find that download type \"#{args[:download_type]}\""
89
81
  end
data/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@geoblacklight/frontend",
3
3
  "type": "module",
4
- "version": "5.1.0",
4
+ "version": "5.2.0",
5
5
  "license": "Apache-2.0",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -28,13 +28,13 @@
28
28
  "leaflet": "^1.9.4",
29
29
  "leaflet-iiif": "^3.0.0",
30
30
  "leaflet-fullscreen": "^1.0.2",
31
- "ol": "8.1.0",
32
- "ol-pmtiles": "^0.3.0"
31
+ "ol": "10.7.0",
32
+ "ol-pmtiles": "^2.0.2"
33
33
  },
34
34
  "devDependencies": {
35
- "jsdom": "^24.1.0",
35
+ "jsdom": "^27.3.0",
36
36
  "rollup-plugin-includepaths": "^0.2.4",
37
- "vite": "^5.0.0",
38
- "vitest": "^2.0.3"
37
+ "vite": "^7.2.2",
38
+ "vitest": "^4.0.15"
39
39
  }
40
40
  }
@@ -94,7 +94,7 @@
94
94
  </query>
95
95
 
96
96
  <requestDispatcher handleSelect="false">
97
- <requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000" formdataUploadLimitInKB="2048"/>
97
+ <requestParsers multipartUploadLimitInKB="2048000" formdataUploadLimitInKB="2048"/>
98
98
  <httpCaching never304="true"/>
99
99
  </requestDispatcher>
100
100
 
@@ -11,6 +11,7 @@ describe Geoblacklight::GeojsonDownload do
11
11
  options = download.instance_variable_get(:@options)
12
12
  expect(options[:content_type]).to eq "application/json"
13
13
  expect(options[:request_params][:typeName]).to eq "stanford-test"
14
+ expect(options[:extension]).to eq "geojson"
14
15
  end
15
16
  it "merges custom options" do
16
17
  download = described_class.new(document, timeout: 33)
data/template.rb CHANGED
@@ -1,29 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- gem "blacklight", "~> 8.0"
4
-
5
- # Ensure the app generates with Propshaft; sprockets is no longer supported
6
- # https://github.com/geoblacklight/geoblacklight/issues/1265
7
- ENV["ENGINE_CART_RAILS_OPTIONS"] = ENV["ENGINE_CART_RAILS_OPTIONS"].to_s + " -a propshaft --css bootstrap"
8
-
9
- # Use importmaps for JS if requested, otherwise default to vite
10
- ENV["ENGINE_CART_RAILS_OPTIONS"] += if ENV["ASSET_PIPELINE"] == "importmap"
11
- " --js importmap"
12
- else
13
- " --js rollup"
14
- end
15
-
16
- # Install latest version of geoblacklight gem if running
17
- # generator with a development branch.
3
+ # Set BRANCH=<branch_name> to install from a specific branch
18
4
  if ENV["BRANCH"]
19
5
  gem "geoblacklight", github: "geoblacklight/geoblacklight", branch: ENV["BRANCH"]
20
6
  else
21
- gem "geoblacklight", "~> 5.0"
7
+ gem "geoblacklight"
22
8
  end
23
9
 
24
10
  run "bundle install"
25
11
 
26
- generate "blacklight:install", "--devise", "--skip-solr"
27
- generate "geoblacklight:install", "-f"
28
-
29
- rake "db:migrate"
12
+ after_bundle do
13
+ generate "blacklight:install", ENV.fetch("BLACKLIGHT_INSTALL_OPTIONS", "--devise --skip-solr")
14
+ generate "geoblacklight:install"
15
+ rails_command "db:migrate"
16
+ end
metadata CHANGED
@@ -1,17 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geoblacklight
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0
4
+ version: 5.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Graves
8
8
  - Darren Hardy
9
9
  - Eliot Jordan
10
10
  - Jack Reed
11
- autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2025-08-11 00:00:00.000000000 Z
13
+ date: 2026-02-18 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: rails
@@ -370,8 +369,7 @@ extensions: []
370
369
  extra_rdoc_files: []
371
370
  files:
372
371
  - ".github/ISSUE_TEMPLATE.md"
373
- - ".github/workflows/build-demo-app.yml"
374
- - ".github/workflows/prune-containers.yml"
372
+ - ".github/dependabot.yml"
375
373
  - ".github/workflows/ruby.yml"
376
374
  - ".gitignore"
377
375
  - ".standard.yml"
@@ -607,9 +605,6 @@ files:
607
605
  - lib/generators/geoblacklight/templates/assets/geoblacklight.scss
608
606
  - lib/generators/geoblacklight/templates/base.html.erb
609
607
  - lib/generators/geoblacklight/templates/catalog_controller.rb
610
- - lib/generators/geoblacklight/templates/demo-app/Dockerfile
611
- - lib/generators/geoblacklight/templates/demo-app/compose.yml
612
- - lib/generators/geoblacklight/templates/demo-app/start-server.sh
613
608
  - lib/generators/geoblacklight/templates/settings.yml
614
609
  - lib/generators/geoblacklight/templates/vite.config.ts
615
610
  - lib/generators/geoblacklight/templates/vite.json
@@ -938,7 +933,6 @@ homepage: http://github.com/geoblacklight/geoblacklight
938
933
  licenses:
939
934
  - Apache 2.0
940
935
  metadata: {}
941
- post_install_message:
942
936
  rdoc_options: []
943
937
  require_paths:
944
938
  - lib
@@ -953,8 +947,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
953
947
  - !ruby/object:Gem::Version
954
948
  version: 2.5.2
955
949
  requirements: []
956
- rubygems_version: 3.5.16
957
- signing_key:
950
+ rubygems_version: 3.6.2
958
951
  specification_version: 4
959
952
  summary: A discovery platform for geospatial holdings
960
953
  test_files: []
@@ -1,156 +0,0 @@
1
- name: Build demo app
2
-
3
- on:
4
- pull_request:
5
- push:
6
- branches:
7
- - main
8
- schedule:
9
- - cron: "0 1 * * SUN" # every sunday at 1AM
10
- workflow_dispatch:
11
-
12
- env:
13
- REGISTRY: ghcr.io
14
- IMAGE_NAME: ${{ github.repository }}
15
- BRANCH: ${{ github.head_ref || github.ref_name }}
16
-
17
- jobs:
18
- build-app:
19
- runs-on: ubuntu-latest
20
- outputs:
21
- artifact-url: ${{ steps.artifact-upload-step.outputs.artifact-url }}
22
- steps:
23
- - uses: actions/checkout@v4
24
- - name: Set up Ruby
25
- uses: ruby/setup-ruby@v1
26
- with:
27
- ruby-version: 3.3.4
28
-
29
- - name: Install dependencies
30
- run: bundle install
31
- env:
32
- RAILS_VERSION: "7.2.2.1"
33
-
34
- - name: Build frontend package
35
- run: |
36
- yarn install
37
- yarn build
38
- yarn link
39
-
40
- - name: Build
41
- run: BRANCH=${{ env.BRANCH }} rails new build -m template.rb -a propshaft --css bootstrap --js rollup
42
-
43
- - name: Cleanup
44
- run: rm -rf build/node_modules build/Gemfile.lock build/yarn.lock build/tmp
45
-
46
- - name: Copy Dockerfile
47
- run: cp lib/generators/geoblacklight/templates/demo-app/Dockerfile build/.
48
-
49
- - name: Copy demo-app compose.yml
50
- run: cp -f lib/generators/geoblacklight/templates/demo-app/compose.yml build/.
51
-
52
- - name: Copy start-server script
53
- run: cp lib/generators/geoblacklight/templates/demo-app/start-server.sh build/.
54
-
55
- - name: Copy fixture solr documents
56
- run: mkdir -p build/spec/fixtures && cp -R spec/fixtures/solr_documents build/spec/fixtures/.
57
-
58
- - name: Replace main image tag with pr tag
59
- if: github.ref_name != 'main'
60
- run: sed -i 's/main/pr-${{ github.event.number }}/g' build/compose.yml
61
-
62
- - name: Upload app build
63
- uses: actions/upload-artifact@v4
64
- id: artifact-upload-step
65
- with:
66
- name: build-${{ env.BRANCH }}
67
- path: build/
68
-
69
- build-docker:
70
- runs-on: ubuntu-latest
71
- needs:
72
- - build-app
73
- steps:
74
- - name: Download app build
75
- uses: actions/download-artifact@v4
76
- with:
77
- name: build-${{ env.BRANCH }}
78
-
79
- - name: Set up QEMU
80
- uses: docker/setup-qemu-action@v3
81
-
82
- - name: Set up Docker Buildx
83
- uses: docker/setup-buildx-action@v3
84
-
85
- - name: Log in to the Container registry
86
- uses: docker/login-action@v3
87
- with:
88
- registry: ${{ env.REGISTRY }}
89
- username: ${{ github.actor }}
90
- password: ${{ secrets.GITHUB_TOKEN }}
91
-
92
- - name: Extract metadata (tags, labels) for Docker
93
- id: meta
94
- uses: docker/metadata-action@v5
95
- with:
96
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
97
- tags: |
98
- type=ref,event=branch
99
- type=ref,event=pr
100
- type=sha
101
- env:
102
- DOCKER_METADATA_PR_HEAD_SHA: true
103
-
104
- # Rebuild base context when triggered by schedule or workflow_dispatch
105
- - name: Build and push base Docker image
106
- uses: docker/build-push-action@v6
107
- if: github.event_name == 'workflow_dispatch' || github.event_name == 'schedule'
108
- with:
109
- context: "${{ github.workspace }}"
110
- file: "${{ github.workspace }}/Dockerfile"
111
- push: true
112
- platforms: linux/amd64,linux/arm64
113
- cache-from: type=gha
114
- cache-to: type=gha,mode=max
115
- tags: ghcr.io/geoblacklight/geoblacklight:base
116
- target: "base"
117
-
118
- # Build only the app context. Build times are faster because most
119
- # gems and node packages are already installed in the base context.
120
- - name: Build and push branch Docker image
121
- uses: docker/build-push-action@v6
122
- with:
123
- context: "${{ github.workspace }}"
124
- file: "${{ github.workspace }}/Dockerfile"
125
- push: true
126
- platforms: linux/amd64,linux/arm64
127
- cache-from: type=gha
128
- cache-to: type=gha,mode=max
129
- tags: ${{ steps.meta.outputs.tags }}
130
- labels: ${{ steps.meta.outputs.labels }}
131
- target: "app"
132
-
133
- notify:
134
- runs-on: ubuntu-latest
135
- if: github.ref_name != 'main'
136
- needs:
137
- - build-app
138
- - build-docker
139
- permissions:
140
- contents: read
141
- packages: write
142
- pull-requests: write
143
- steps:
144
- - name: Add artifact link to PR comments
145
- uses: mshick/add-pr-comment@v2
146
- with:
147
- message: |
148
- Demo app download link: ${{ needs.build-app.outputs.artifact-url }}
149
-
150
- 1. Download demo app and unzip file
151
- 2. Change into app directory
152
- - run `docker compose pull`
153
- - run `docker compose up`
154
- 3. Open in browser
155
- - App: http://127.0.0.1:3001
156
- - Solr: http://127.0.0.1:8984
@@ -1,19 +0,0 @@
1
- name: Prune containers
2
-
3
- on:
4
- workflow_dispatch:
5
- schedule:
6
- - cron: "0 0 * * SUN" # every sunday at midnight
7
-
8
- jobs:
9
- clean:
10
- runs-on: ubuntu-latest
11
- name: Delete old images
12
- steps:
13
- - uses: snok/container-retention-policy@v3.0.0
14
- with:
15
- account: geoblacklight
16
- image-names: geoblacklight
17
- token: ${{ secrets.GITHUB_TOKEN }}
18
- image-tags: "!main !base"
19
- cut-off: 2w
@@ -1,31 +0,0 @@
1
- # syntax = docker/dockerfile:1
2
-
3
- # Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
4
- ARG RUBY_VERSION=3.3.4
5
- FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim AS base
6
-
7
- RUN apt-get update -qq && \
8
- apt-get install --no-install-recommends -y build-essential git pkg-config nodejs npm curl libsqlite3-0
9
-
10
- RUN npm install --global yarn
11
-
12
- ENV RAILS_ENV="development" \
13
- BUNDLE_PATH="/usr/local/bundle"
14
-
15
- # Rails app lives here
16
- WORKDIR /rails
17
-
18
- # Install gems and javascript packages
19
- COPY Gemfile .
20
- RUN bundle install
21
- COPY package.json .
22
- RUN yarn install
23
-
24
- FROM ghcr.io/geoblacklight/geoblacklight:base AS app
25
-
26
- # Add application code
27
- COPY . .
28
-
29
- # Run the server script by default, this can be overwritten at runtime
30
- EXPOSE 3000
31
- CMD ["sh", "start-server"]
@@ -1,26 +0,0 @@
1
- services:
2
- app:
3
- image: ghcr.io/geoblacklight/geoblacklight:main
4
- ports:
5
- - "3001:3001"
6
- links:
7
- - "solr:solr"
8
- environment:
9
- SOLR_URL: "http://solr:8983/solr/blacklight-core"
10
- RAILS_DEVELOPMENT_HOSTS: ".githubpreview.dev,.preview.app.github.dev,.app.github.dev,.csb.app"
11
- depends_on:
12
- - solr
13
- command: sh start-server.sh
14
- solr:
15
- image: solr:9.6.1
16
- volumes:
17
- - $PWD/solr/conf:/opt/solr/conf
18
- ports:
19
- - 8984:8983
20
- entrypoint:
21
- - docker-entrypoint.sh
22
- - solr-precreate
23
- - blacklight-core
24
- - /opt/solr/conf
25
- - "-Xms256m"
26
- - "-Xmx512m"
@@ -1,21 +0,0 @@
1
- #!/bin/sh
2
-
3
- bundle install
4
- yarn install
5
-
6
- # Build and Install local copy of @geoblackligt/frontend
7
- # These steps are included in the docker image instead if the image build script
8
- # to reduce the size of the layers that docker compose has to pull with each new version.
9
- gempath=$(bundle exec gem which geoblacklight | sed 's/\/lib\/geoblacklight.rb//')
10
- if [ ! -d "$gempath/dist/" ]; then
11
- cd $gempath
12
- yarn install
13
- yarn vite build
14
- cd -
15
- fi
16
- yarn add file:$gempath
17
-
18
- # Start the server
19
- bundle exec rake db:prepare
20
- bundle exec rake geoblacklight:index:seed
21
- bundle exec rails server -b 0.0.0.0 -p 3001