Skip to content

Commit

Permalink
adds shakapacker install; updates docs
Browse files Browse the repository at this point in the history
  • Loading branch information
JackBlackLight committed Jan 13, 2025
1 parent fbe04a8 commit 20ae273
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if fa_token
gem 'font-awesome-pro-sass', '~> 6.4.0'
end
else
raise 'ERROR: You are missing font_awesome_token in secrets.yml. It is required for `bundle install` to work.'
raise 'ERROR: You are missing font_awesome_token in font_awesome_token.yml. It is required for `bundle install` to work.'
end
gem 'actionpack-action_caching'
gem 'bootsnap', '~> 1.9.3'
Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ application up and running?
* Database initialization
* `bundle exec rake db:seed`

* encrypted credentials
* the application expects keys in the following format:
```yml
development:
devise_secret_key: $DEVISE_SECRET_KEY
secret_key_base: $SECRET_KEY_BASE
session_store_key: $SESSION_KEY
```
## User permissions and restricted access Assets
Although Item metadata records are generally visible in DLC, some Assets are restricted and require your currently logged in user to have the correct permissions. For how to configure user permissions, see: [https://wiki.library.columbia.edu/display/DLC/Authorization+Metadata]
Expand Down
4 changes: 1 addition & 3 deletions docker/bind_mount/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# docker-compose.yml
version: '3.8'

services:
dlc:
build:
context: ../../.
dockerfile: docker/bind_mount/Dockerfile
container_name: dlc-dev
ports:
- "3000:3000" # Rails server
- "3035:3035" # Shakapacker dev server
Expand Down
16 changes: 15 additions & 1 deletion docker/bind_mount/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ trap cleanup SIGINT SIGTERM
# Remove a potentially pre-existing server.pid for Rails.
rm -f ./tmp/pids/server.pid

# shakapacker has no promptless option without overwriting, so we preserve and restore existing config
echo "Checking shakapacker installation..."
cp config/shakapacker.yml config/shakapacker.yml.dlc
cp config/webpack/webpack.config.js config/webpack/webpack.config.js.dlc
cp package.json package.json.dlc

FORCE=true bundle exec rails shakapacker:install

mv config/shakapacker.yml.dlc config/shakapacker.yml
mv config/webpack/webpack.config.js.dlc config/webpack/webpack.config.js
mv package.json.dlc package.json

yarn add jquery --save

echo "Running database migrations ..."
bundle exec rails db:migrate

Expand All @@ -29,7 +43,7 @@ bundle exec rake dcv:sites:seed_from_solr

trap cleanup SIGTERM

#Execute command
echo "Starting rails and shakapacker-dev-server"
"${@}" &

#keep as main process so that SIGTERM triggers cleanup
Expand Down

0 comments on commit 20ae273

Please sign in to comment.