Commit 0a4f2dc3 authored by Hoop, Bert Jan de's avatar Hoop, Bert Jan de
Browse files

L02COLL-837 update

parent 1f9c08e5
# Linkresolver
The linkresolver is a Ruby on Rails application based on the open source umlaut gem.
## Development environment
The umlaut gem requires Ruby 2.2 and Rails 4.2.5.
It doesn't seem to work with a newer version of Ruby but Ruby 2.2 is no longer supported in modern linux distributions.
For developing and testing the linkresolver there is docker container setup.
### Docker containers
Requirements: recent versions of docker and docker-composer installed.
The development environment consists of 2 containes, one container for the linkresolver (web)
and an other container for the mysql database (db). The web container is defined in de Dockerfile.
The db container uses a standard mysql container. The docker-compose.yml file is used to
start both containers.
Start the development environment with:
$ docker-compose up
This command starts both containers. The first time it is called it will also build the containers.
If a new web container is needed, which is only neccesary if the content of the Gemfile or start-linkresolver script
has changed, it can be build with this commando:
$ docker-compose up --build
There is no need to build a new web container when de ruby code has changed because the ruby code is accessed
by the web container through a filesystem mount. Changes in the ruby code are directly active in the linkresolver.
But be aware that the linkresolver stores/caches all requests in the mysql db. So when you change the code and
request the same url again you probably won't see the new behaviour. In that case you have to 'restart' the
containers to 'empty' the database.
To stop the containers use (in a second console):
$ docker-compose down
Before you can use the development environment to test the code you have to provide the secret keys (environment variables) for the OCLC and BX services in the docker-linkresolver.env file.
WS_KEY=<oclc secret key>
BX_TOKEN=<bx secret key>
Be aware: do **NOT** commit the secret keys in the repository!!
You can query the development environment in your browser with an url like this:
The log output is written to stdout en to the log files in the log/ directory.
## Deployment
The linkresolver is run on the test (scomp1143) and production (scomp1121) servers in the passenger application server.
The client requests are proxied by apache to the linkresolver instance.
Commands when deploying a new version of the linkresolver on a server (as root):
# cd /srv/git/library/linkresolver_master/
# sudo -u linkresolver git pull
# restart-linkresolver
Above commands are for the test server (scomp1143). For production the linkresolver code is located in /srv/git/library/linkresolver_prod/.
To empty the database, which can be usefull to remove incorrect (cached) responses use the command:
# clear-linkresolver-db
This README would normally document whatever steps are necessary to get the
application up and running.
Things you may want to cover:
* Ruby version
* System dependencies
* Configuration
* Database creation
* Database initialization
* How to run the test suite
* Services (job queues, cache servers, search engines, etc.)
* Deployment instructions
* ...
Please feel free to use a different markup language if you do not plan to run
<tt>rake doc:app</tt>.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment