-
Notifications
You must be signed in to change notification settings - Fork 4
Common (Docker) Tasks
maxwellbenjamin edited this page Sep 10, 2019
·
2 revisions
-
Start Solr, Fedora, and Rails servers
- Type
cd ./ucla2019
to change directory to the root of your Rails application - Type
docker-compose up
- Type
-
Shut down Solr, Fedora, and Rails servers
- In the terminal window where your servers are running, type ctrl-C
-
Alternative: In your main terminal window, in your project context, type
docker-compose down
.
-
Start a Bash session to your application container
- Type
cd ./ucla2019
to change directory to the root of your Rails application - Type
docker-compose run web bash
to connect to a command prompt running in the application container - Type
exit
when you're done to return to to your local system
- Type
-
Start a Rails console
- Type
cd ./ucla2019
to change directory to the root of your Rails application - Type
docker-compose run web rails console
to enter the console (orrails c
for shorthand) - Type
exit
when you're done to return to your local system
- Type
-
Fix Solr if you get an error like
ERROR: Core 'hydra-test' already exists!
- Clear the test solr instance using
rm -rf tmp/solr-test/server/solr/hydra-test
-
ALTERNATE Try
solr_wrapper --config config/solr_wrapper_test.yml clean
- Try
rails ci
again and things should work; if not, ask for help!
- Clear the test solr instance using
-
Re-set Repository (without re-pulling code)
- Keep servers running
- In a rails console (
docker-compose run web rails console
)- Clean out Fedora
require 'active_fedora/cleaner' ActiveFedora::Cleaner.clean!
- Clean out Solr
Blacklight.default_index.connection.delete_by_query("*:*"); Blacklight.default_index.connection.commit
- On the command line
docker-compose run web bundle exec rake db:reset
- On the command line,
- Standard new repo set-up
docker-compose run web bundle install docker-compose run web rails db:migrate docker-compose up docker-compose run web rails hyrax:default_collection_types:create docker-compose run web rails hyrax:default_admin_set:create
- To use byebug:
- After hitting the byebug in your code, run docker ps to get the id for the web container. Copy that id and then run:
docker attach 943094304
- Hit enter and you'll be in the byebug.