Last active
November 5, 2024 00:35
-
-
Save mark-cooper/0fb03183feddacc9dc0fc19c675df71e to your computer and use it in GitHub Desktop.
Load ArchivesSpace backend in a pry session
This file contains hidden or 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 rbenv | |
# rbenv install jruby-9.4.8.0 && rbenv local jruby-9.4.8.0 && gem install bundler pry | |
# docker-compose -f docker-compose-dev.yml build | |
# docker-compose -f docker-compose-dev.yml up --detach | |
# ./build/run bootstrap && ./build/run db:migrate | |
# chmod u+x ./ascli | |
# ./ascli | |
export ASCLI_RUNNER=${1:-rbenv} | |
export ASPACE_ENV=development | |
export RUBYLIB=$PWD/common/ | |
export CLASSPATH=$PWD/build/*:$PWD/common/lib/* | |
export GEM_HOME=$PWD/build/gems/jruby/3.1.0/gems | |
export BUNDLE_BIN_PATH=/build/gems/jruby/3.1.0/bin | |
export BUNDLE_PATH=$GEM_HOME | |
export BUNDLE_GEMFILE=$PWD/backend/Gemfile | |
JAVA_OPTS="$JAVA_OPTS -Daspace.config.db_url=jdbc:mysql://127.0.0.1:3306/archivesspace?useUnicode=true&characterEncoding=UTF-8&user=as&password=as123&useSSL=false&allowPublicKeyRetrieval=true" | |
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 -Xmx512m -Xss512m" | |
export JAVA_OPTS | |
PATH=$(dirname $($ASCLI_RUNNER which gem)):$PATH | |
ruby -e 'puts $:' | |
bundle install | |
# for the webserver | |
bundle exec jruby -I ./common/ ./backend/app/main.rb | |
# for the console | |
# 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
Also needed:
And: