Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export DIRENV_WARN_TIMEOUT=20s
export NIXPKGS_ALLOW_INSECURE=1

eval "$(devenv direnvrc)"

use devenv
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@ node_modules
# https://vitejs.dev/guide/env-and-mode.html#env-files
*.local


# Devenv
.devenv*
devenv.local.nix

# direnv
.direnv

# pre-commit
.pre-commit-config.yaml
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ gem "bagit", "~> 0.4"
# Pin to prevent passenger error
gem "base64", "0.1.1"
gem "blacklight", "~> 7.33"
gem "blacklight_iiif_search", "~> 2.1.0"
gem "blacklight_iiif_search", "~> 2.1.0", github: "pulibrary/blacklight_iiif_search", branch: "ffi_patch"
gem "blacklight_range_limit"
gem "bootsnap", require: false
gem "bootstrap", "~> 4.0"
Expand All @@ -31,7 +31,7 @@ gem "dnsruby"
gem "draper"
gem "ezid-client", "1.9.4" # v1.9.0 introduces response errors in our tests/stubbing
gem "faker"
gem "ffi", "~> 1.16.0"
gem "ffi", "~> 1.17.0"
gem "filewatcher", "~> 1.0"
gem "flutie"
gem "font-awesome-rails"
Expand Down
25 changes: 16 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ GIT
devise-guests (0.8.3)
devise

GIT
remote: https://github.com/pulibrary/blacklight_iiif_search.git
revision: 0533d15ca417be0c9535fca7dd39326c9a47cc80
branch: ffi_patch
specs:
blacklight_iiif_search (2.1.0)
blacklight (~> 7.0)
iiif-presentation
rails (>= 6, < 7.3)

GIT
remote: https://github.com/pulibrary/mediainfo.git
revision: 58f3e304f01009b459954b82d0675562106b1ac8
Expand Down Expand Up @@ -257,11 +267,6 @@ GEM
blacklight (> 6.0, < 8)
cancancan (>= 1.8)
deprecation (~> 1.0)
blacklight_iiif_search (2.1.0)
blacklight (~> 7.0)
ffi (~> 1.16.3)
iiif-presentation
rails (>= 6, < 7.3)
blacklight_range_limit (8.5.0)
blacklight (>= 7.25.2, < 9)
deprecation
Expand Down Expand Up @@ -439,7 +444,9 @@ GEM
net-http (>= 0.5.0)
faraday-retry (2.2.1)
faraday (~> 2.0)
ffi (1.16.3)
ffi (1.17.1-arm64-darwin)
ffi (1.17.1-x86_64-darwin)
ffi (1.17.1-x86_64-linux-gnu)
filewatcher (1.1.1)
optimist (~> 3.0)
flutie (2.2.0)
Expand Down Expand Up @@ -1126,7 +1133,7 @@ DEPENDENCIES
benchmark-ips
bixby (~> 5.0)
blacklight (~> 7.33)
blacklight_iiif_search (~> 2.1.0)
blacklight_iiif_search (~> 2.1.0)!
blacklight_range_limit
bootsnap
bootstrap (~> 4.0)
Expand All @@ -1153,7 +1160,7 @@ DEPENDENCIES
ezid-client (= 1.9.4)
factory_bot_rails
faker
ffi (~> 1.16.0)
ffi (~> 1.17.0)
filewatcher (~> 1.0)
flutie
font-awesome-rails
Expand Down Expand Up @@ -1252,4 +1259,4 @@ DEPENDENCIES
whenever (~> 1.0)

BUNDLED WITH
2.4.19
2.5.22
62 changes: 11 additions & 51 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,63 +11,25 @@ A digital repository application in use at Princeton University Library for stor

Follow these steps the first time you clone this project to run in dev or test.

#### Install Language Dependencies

- We use asdf to manage language dependencies. If you don't have it installed do `brew install asdf`.
- To support Java on Mac via asdf, add the following line to your `~/.asdfrc` file:
```
java_macos_integration_enable = yes
```
- If your `~/.asdfrc` has this line you may need to remove it:
```
legacy_version_file = yes
```
- After making these changes open a new terminal window for figgy.
- Run `./bin/setup_asdf`. This script ensures all required plugins are installed and then installs all language dependencies specified in `.tool-versions`.

#### Install Package Dependencies

- First follow package setup for Mac M series processors (below) if needed
- Then run `./bin/setup` to ensure that required dependencies via homebrew, pip, bundler, and yarn.

Remember you'll need to run `bundle install` and `yarn install` on an ongoing basis as dependencies are updated.

##### Package Setup for Mac M Series Processors

Mapnik currently isn't supported by M-series processors, so `yarn install` above will
fail. To get this working, do the following:

1. $ arch -x86_64 /bin/zsh --login
1. you can validate that it's running the right architecture now by viewing the output of the `arch` command
1. `asdf uninstall nodejs`
1. `asdf uninstall yarn`
1. `rm ~/.asdf/shims/yarn`
1. `asdf install nodejs`
1. `npm install -g yarn`
1. `yarn install`
1. open a new Terminal or otherwise go back to the arm64 arch.
1. Add the following to `~/.zshrc` or `~/.zshrc.local`:
Install Nix:

```
# Fix issue with homebrew postgres and rails applications (Figgy in
particular).
# See: https://github.com/ged/ruby-pg/issues/538
export PGGSSENCMODE="disable"
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install \
--extra-conf "trusted-users = root ${USER}" \
--no-confirm
```

#### Install Lando
Restart terminal

Lando will automatically set up docker images for Solr and Postgres which match
the versions we use in Production. The ports will not collide with any other
projects you're using Solr/Postgres for, and you can easily clean up with `lando
destroy` or turn off all services with `lando poweroff`.
Install devenv:

1. Install Lando DMG from [[https://github.com/lando/lando/releases]]
`nix-env --install --attr devenv -f https://github.com/NixOS/nixpkgs/tarball/nixpkgs-unstable`

### Every time setup

Follow these steps every time you start new work in this project in dev or test

1. Run `bundle exec rake servers:start` to start lando services and set up database state.
- `./bin/shell` will open a shell for the project.
- `setup` will launch all the required services and get the app ready.
* `tests` will run all the tests.

### Running tests

Expand All @@ -85,8 +47,6 @@ http://localhost:7900, use the password `secret`, and run tests like this:

If you'd like to run the test suite in parallel do the following:

1. `bundle exec rake servers:start`
1. `PARALLEL_TEST_FIRST_IS_1=true RAILS_ENV=test rake parallel:setup` (Sets up suport database; only needed after db has been destroyed)
1. `./bin/parallel_rspec_coverage`

The output from the parallel runs will be interspersed, and the failures will be
Expand Down
4 changes: 4 additions & 0 deletions bin/shell
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

export NIXPKGS_ALLOW_INSECURE=1
devenv shell
Loading