Skip to content

Commit 9759de2

Browse files
yzhoubkDaniel Schmidt
authored andcommitted
AP-281: Upgrade Geoblacklight to 4.4.2
this takes commits 454f840..4c275f6 and squashes them down to clear up a complex branch history. install yarn and node.js, setup add javascript entrypoints but not work test rebuilding configure local vite build segment error rm log file rm .npm docker and compose file update installtion clean up update artifact action from v3 to v4 DP-1469: upgrade postgres image to v16.4 Upgrade github actions Adding container image and root user in the test job Adding container image and root user in the test job rm init in test job GHA: Run tests with user=root Allow starting solr as root remove: Allow starting solr as root matching puma version with rackup version to fix puma issue on running rake commands update a spec file git ignore yarn folder clr Dockfile calnet login page test Update some localize strings clr gitignore file clean up spec test 2. rubocop correction 3. added package clean up in Docker file; clean up Gemfile 4. Remove old build.yml 5. clean up spec_helper.rb, devise.rb Co-authored-by: Daniel Schmidt <dcschmidt@berkeley.edu>
1 parent ef1c127 commit 9759de2

File tree

20 files changed

+4418
-388
lines changed

20 files changed

+4418
-388
lines changed

.gitignore

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
*.rbc
2-
capybara-*.html
3-
.bash*
4-
.rspec
5-
/db/*.sqlite3
6-
/db/*.sqlite3-journal
7-
/db/*.sqlite3-[0-9]*
8-
/public/system
9-
/coverage/
10-
/spec/tmp
11-
*.orig
12-
rerun.txt
13-
pickle-email-*.html
14-
151
# Ignore all logfiles and tempfiles.
162
/log/*
173
/tmp/*
@@ -29,6 +15,8 @@ config/master.key
2915
# TODO Comment out this rule if environment variables can be committed
3016
.env
3117

18+
.bash*
19+
3220
## Environment normalization:
3321
/.bundle
3422
/vendor/bundle
@@ -38,22 +26,10 @@ config/master.key
3826
# these should all be checked in to normalize the environment:
3927
# Gemfile.lock, .ruby-version, .ruby-gemset
4028

41-
# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
42-
.rvmrc
43-
44-
# if using bower-rails ignore default bower_components path bower.json files
45-
/vendor/assets/bower_components
46-
*.bowerrc
47-
bower.json
48-
49-
# Ignore pow environment settings
50-
.powenv
51-
52-
# Ignore Byebug command history file.
29+
# Ignore command history file.
5330
.byebug_history
31+
.irb_history
5432

55-
# Ignore Bash history file.
56-
.bash_history
5733

5834
# Ignore node_modules
5935
node_modules/
@@ -65,17 +41,23 @@ node_modules/
6541

6642
# Ignore yarn files
6743
/yarn-error.log
44+
/.yarnrc
6845
yarn-debug.log*
46+
yarn.lock
47+
.yarn
6948
.yarn-integrity
7049

71-
# Ignore uploaded files in development
72-
/storage/*
73-
!/storage/.keep
50+
# Ignore .npm files
51+
/.npm
7452

7553
# Build/test artifacts
7654
/artifacts/
7755

7856
# Ignore solr files
7957
solr/*/data/*
8058

81-
.irb_history
59+
# Vite Ruby
60+
/public/vite*
61+
# Vite uses dotenv and suggests to ignore local-only env files. See
62+
# https://vitejs.dev/guide/env-and-mode.html#env-files
63+
*.local

Dockerfile

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,40 @@ RUN apt-get update -qq
2525

2626
# Install standard packages from the Debian repository
2727
RUN apt-get install -y --no-install-recommends \
28-
bash \
29-
curl \
30-
default-jre \
31-
ca-certificates \
32-
nodejs \
33-
libpq-dev \
34-
libvips42 \
35-
yarn\
36-
&& rm -rf /var/cache/apk/*
28+
bash \
29+
curl \
30+
default-jre \
31+
ca-certificates \
32+
libpq-dev \
33+
libvips42 \
34+
&& rm -rf /var/cache/apk/*
35+
36+
# Install Node.js (using NodeSource to get the latest LTS version, e.g., 20.x)
37+
RUN curl -fsSL https://deb.nodesource.com/setup_20.x| bash - \
38+
&& apt-get install -y --no-install-recommends nodejs \
39+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
40+
41+
# Install Yarn (using the official Yarn repository)
42+
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
43+
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
44+
&& apt-get update && apt-get install -y --no-install-recommends yarn \
45+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
3746

3847
# By default, run as the geodata user
39-
USER geodata
48+
USER $APP_USER
4049

4150
# All subsequent commands run relative to the app directory.
4251
WORKDIR /opt/app
4352

4453
# Add binstubs to the path.
4554
ENV PATH="/opt/app/bin:$PATH"
4655

47-
4856
# If run with no other arguments, the image will start the rails server by
4957
# default. Note that we must bind to all interfaces (0.0.0.0) because when
5058
# running in a docker container, the actual public interface is created
5159
# dynamically at runtime (we don't know its address in advance).
5260
CMD ["rails", "server", "-b", "0.0.0.0", "--pid", "/tmp/puma.pid"]
5361

54-
5562
# ============================================================================
5663
# Target: development
5764
# Installs all dependencies, requiring the (large) build-base package. Build
@@ -68,7 +75,7 @@ RUN apt-get install -y --no-install-recommends \
6875
make
6976

7077
# Drop back to the GeoData user
71-
USER geodata
78+
USER $APP_USER
7279

7380
# Copy over only the files which are needed to perform a bundle install.
7481
COPY --chown=geodata .ruby-version Gemfile* ./
@@ -79,8 +86,7 @@ COPY --chown=geodata . .
7986

8087
# Create cache/pids/etc directories.
8188
RUN bundle exec -- rails log:clear tmp:create \
82-
&& rails assets:precompile
83-
RUN mkdir tmp/cache/downloads
89+
&& rails assets:precompile
8490

8591
# ============================================================================
8692
# Target: production
@@ -93,7 +99,6 @@ FROM base AS production
9399
COPY --from=development --chown=geodata /opt/app /opt/app
94100
COPY --from=development --chown=geodata /usr/local/bundle /usr/local/bundle
95101

96-
97102
# Sanity-check that the bundle is correctly installed, that the Gemfile
98103
# and Gemfile.lock are synced, and that assets are able to be compiled.
99104
# no need to run bundle install
@@ -116,4 +121,4 @@ ENV BUILD_URL="${BUILD_URL}"
116121
ENV DOCKER_TAG="${DOCKER_TAG}"
117122
ENV GIT_REF_NAME="${GIT_REF_NAME}"
118123
ENV GIT_SHA="${GIT_SHA}"
119-
ENV GIT_REPOSITORY_URL="${GIT_REPOSITORY_URL}"
124+
ENV GIT_REPOSITORY_URL="${GIT_REPOSITORY_URL}"

Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ gem 'bootsnap', require: false
99
gem 'bootstrap', '~> 4.0'
1010
gem 'devise'
1111
gem 'devise-guests', '~> 0.8'
12-
gem 'geoblacklight', '~> 4.1.1'
12+
gem 'geoblacklight', '~> 4.4.2'
1313
gem 'importmap-rails'
1414
gem 'jbuilder'
1515
gem 'jquery-rails'
@@ -19,7 +19,7 @@ gem 'omniauth-rails_csrf_protection', '~> 1.0'
1919
gem 'pg', '~> 1.4.6'
2020
gem 'puma', '~> 6.4.1'
2121
gem 'rack-timeout', '~> 0.6.3'
22-
gem 'rails', '~> 7.0.8'
22+
gem 'rails', '~> 7.1.5'
2323
gem 'rsolr', '>= 1.0', '< 3'
2424
gem 'sassc-rails', '~> 2.1'
2525
gem 'sprockets', '< 4.0'
@@ -28,17 +28,16 @@ gem 'stimulus-rails'
2828
gem 'turbo-rails'
2929
gem 'twitter-typeahead-rails', '0.11.1.pre.corejavascript'
3030
gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby]
31+
gem 'vite_rails', '~> 3.0'
3132

3233
group :development, :test do
33-
# gem 'colorize'
3434
gem 'brakeman'
3535
gem 'debug', platforms: %i[mri mingw x64_mingw]
3636
gem 'rspec-rails'
3737
gem 'rubocop', require: false
3838
gem 'rubocop-rails', '~> 2.19', '>= 2.19.1', require: false
3939
gem 'rubocop-rspec', '~> 2.20', require: false
4040
gem 'solr_wrapper', '>= 0.3'
41-
# gem 'factory_bot_rails'
4241
end
4342

4443
group :development do

0 commit comments

Comments
 (0)