From d0e08081ef95ac6df61e67b806ea89662be2cfc8 Mon Sep 17 00:00:00 2001 From: yzhoubk <30507097+yzhoubk@users.noreply.github.com> Date: Thu, 21 Dec 2023 11:34:57 -0800 Subject: [PATCH] DEV-430: Move tmp to data/gingr (#13) --- .gitignore | 2 ++ data/gingr/processing/.keep | 0 docker-compose.yml | 1 - lib/gingr/cli.rb | 4 +++- lib/gingr/config.rb | 2 +- 5 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 data/gingr/processing/.keep diff --git a/.gitignore b/.gitignore index 1cd1499..fcbe699 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ /data/gingr/ready/* /data/gingr/processed/* /data/gingr/failed/* +/data/gingr/processing/* + /solr/geodata-test/data /solr/geodata-test/data diff --git a/data/gingr/processing/.keep b/data/gingr/processing/.keep new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml index 054ffb1..32682cf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,7 +16,6 @@ services: GEOSERVER_URL: http://admin:geoserver@geoserver:8080/geoserver/rest/ SOLR_URL: http://solr:8983/solr/geodata-test SPATIAL_ROOT: data/spatial/ - PROCESSING_ROOT: data/processing/ restart: no volumes: - ./:/opt/app:delegated diff --git a/lib/gingr/cli.rb b/lib/gingr/cli.rb index 193d1dd..d046389 100644 --- a/lib/gingr/cli.rb +++ b/lib/gingr/cli.rb @@ -88,7 +88,9 @@ def unpack(zipfile) Config.default_options[:spatial_root]) DataHandler.geoserver_root = options[:geoserver_root] || ENV.fetch('GEOSERVER_ROOT', Config.default_options[:geoserver_root]) - DataHandler.processing_root = ENV.fetch('PROCESSING_ROOT', Config.default_options[:processing_root]) + + gingr_watch_root_dir ||= ENV['GINGR_WATCH_DIRECTORY'] || '/opt/app/data/gingr' + DataHandler.processing_root = File.join(gingr_watch_root_dir, 'processing') DataHandler.extract_and_move(zipfile_path) end diff --git a/lib/gingr/config.rb b/lib/gingr/config.rb index cc02424..98f5b08 100644 --- a/lib/gingr/config.rb +++ b/lib/gingr/config.rb @@ -19,7 +19,7 @@ module Config spatial_url: 'https://spatial.lib.berkeley.edu', spatial_root: 'data/spatial/', geoserver_root: 'data/geoserver/', - processing_root: 'data/processing/', + # processing_root: 'data/gingr/processing/', solr_url: 'http://solr:8983/solr/geodata-test' }