Avalon Media System is an open source system for managing large collections of digital audio and video. The project is led by Indiana University Libraries.
For more information and regular project updates visit the Avalon website and documentation wiki.
Installation instructions are available on Avalon's documentation site:
Using Docker is the recommended method of setting up an Avalon Media System Development Environment. It can be completed in minutes without installing any dependencies beside Docker itself. It should be noted that the docker-compose.yml provided here is for development only and will be updated continually.
git clone https://github.com/avalonmediasystem/avalon
cd avalon
cp config/controlled_vocabulary.yml.example config/controlled_vocabulary.yml
docker-compose pull
docker-compose run createbuckets
docker-compose up avalon worker
localhost:3000
Avalon is served by Webrick in development mode so any changes will be picked up automatically.
Rails debugging with Pry can be accessed by attaching to the docker container: docker attach avalon_container_name
, make sure your container is running in background (detached mode). Now, when you reach a binding.pry breakpoint in rails, you can step through the breakpoint in that newly attached session.
To get live compilation and hot-reload when developing with Javascript, run WEBPACKER_DEV_SERVER_HOST=0.0.0.0 $NODE_PATH/.bin/webpack-dev-server --config /home/app/avalon/config/webpack/development.js
inside the avalon container.
To run tests, first bring up the test stack then run Rspec as usual:
docker-compose up test
docker-compose exec test bash -c "bundle exec rspec"
To run Cypress E2E tests, first bring up the development stack, manually create testing users, and then bring up the cypress container:
docker-compose up avalon
docker-compose exec avalon bash -c "bundle exec rake avalon:user:create avalon_username=administrator@example.com avalon_password=password avalon_groups=administrator"
docker-compose exec avalon bash -c "bundle exec rake avalon:user:create avalon_username=user@example.com avalon_password=password"
docker-compose exec avalon bash -c "bundle exec rake avalon:test:media_object id=123456789 collection=123456789"
docker-compose up cypress
Warning: The docker instructions above are the currently maintained development environment. If you're unable to use docker you can try the instructions below but they may be out of date.
The following steps will let you run the avalon stack locally in order to explore the out-of-the-box functionality or do basic development.
config/settings/development.local.yml
if necessarycp config/controlled_vocabulary.yml.example config/controlled_vocabulary.yml
bundle install
rake secret
rake avalon:services:start
rake avalon:db_migrate
rake db:test:prepare
bundle exec rake server:development
or bundle exec rake server:test
Note: This process will not background itself, it will occupy the terminal you run it inTo take advantage of multistage and parallel build, Docker buildkit is recommended.
docker build -t myorg/avalon:version --target=prod .
In order to run eslint on javascript files to check prior to creating a pull request do the following:
npm install -g eslint
eslint app/assets/javascripts/ --ext .js,.es6
To maintain a consistent style of .js/.es6 code, the Prettier package should be used to clean up code before submitting a pull request.
yarn global add prettier
or npm install --global prettier
prettier
CLI command from the application root directory, for example: prettier --write "app/assets/javascripts/media_player_wrapper/*.es6"
Testing support for Avalon Media System is provided by BrowserStack.