Last active
March 7, 2022 23:11
-
-
Save mark-cooper/0fb03183feddacc9dc0fc19c675df71e to your computer and use it in GitHub Desktop.
Load ArchivesSpace backend in a pry session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SETUP: requires asdf || rbenv | |
# asdf install ruby jruby-9.2.20.1 && asdf local ruby jruby-9.2.20.1 && gem install bundler pry | |
# rbenv install jruby-9.2.20.1 && rbenv local jruby-9.2.20.1 && gem install bundler pry | |
# chmod u+x ./ascli | |
# ./build/run bootstrap && ./build/run db:migrate | |
# ./ascli (default asdf) # ./ascli rbenv | |
export ASCLI_RUNNER=${1:-asdf} # or rbenv | |
export RUBYLIB=$PWD/common/ | |
export CLASSPATH=$PWD/build/*:$PWD/common/lib/* | |
export GEM_HOME=$PWD/build/gems/jruby/2.5.0/gems | |
export BUNDLE_PATH=$GEM_HOME | |
export BUNDLE_GEMFILE=$PWD/backend/Gemfile | |
JAVA_OPTS="$JAVA_OPTS -Daspace.config.search_user_secret=devserver -Daspace.config.public_user_secret=devserver" | |
JAVA_OPTS="$JAVA_OPTS -Daspace.config.staff_user_secret=devserver -Daspace.config.frontend_cookie_secret=devserver" | |
JAVA_OPTS="$JAVA_OPTS -Daspace.config.public_cookie_secret=devserver -Daspace.config.solr_url=http://localhost:8983/solr/archivesspace" | |
JAVA_OPTS="$JAVA_OPTS -Daspace.config.data_directory=$PWD/build -Dfile.encoding=UTF-8 -Daspace.devserver=true" | |
JAVA_OPTS="$JAVA_OPTS -XX:MaxPermSize=200m -Xmx512m -Xss512m" | |
export JAVA_OPTS | |
PATH=$(dirname $($ASCLI_RUNNER which gem)):$PATH | |
ruby -e 'puts $:' | |
bundle install | |
bundle exec pry -I ./common/ -r ./backend/app/main.rb | |
# RequestContext.open(repo_id: 2) { Accession.find(1) } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment