Skip to content
Snippets Groups Projects
README.md 4.21 KiB
Newer Older
[![build status](https://git-r3lab.uni.lu/piotr.gawron/minerva/badges/master/build.svg)](https://git-r3lab.uni.lu/piotr.gawron/minerva/commits/master)
Piotr Gawron's avatar
Piotr Gawron committed

Piotr Gawron's avatar
Piotr Gawron committed
# For users
Documentation for minerva can be found here: https://minerva.pages.uni.lu/doc/
Piotr Gawron's avatar
Piotr Gawron committed
# For developers
Piotr Gawron's avatar
Piotr Gawron committed
## Installation
Piotr Gawron's avatar
Piotr Gawron committed
After cloning repo you need to install following tools:
* postgresql (>=9.1)
* tomcat (tested on tomcat7)
* Java8 - works on both OpenJDK 8 and Oracle Java 8
* maven
* ant
* node.js + npm
Piotr Gawron's avatar
Piotr Gawron committed
You need to create user and database:
Piotr Gawron's avatar
Piotr Gawron committed
username: map_viewer
password: 123qweasdzxc
dbname: map_viewer
Piotr Gawron's avatar
Piotr Gawron committed
If you want to use different credentials or your database in not hosted locally you can configure it by creating file `/etc/minerva/db.properties`. Template of the file can be found here: https://git-r3lab.uni.lu/minerva/core/blob/master/persist/src/main/resources/db.properties
Piotr Gawron's avatar
Piotr Gawron committed
Database schema is managed automatically by [flyway](https://flywaydb.org/), so there is no need to populate the database with anything.
Piotr Gawron's avatar
Piotr Gawron committed
Now your dev environment is configured and ready to use. To test it you can run unit tests:
* back-end - go to one of the Java modules (ie 'persist') and call mvn test:
Piotr Gawron's avatar
Piotr Gawron committed
cd ~/workspace/minerva/commons/
mvn test
Piotr Gawron's avatar
Piotr Gawron committed
* front-end - go to module with front-end, install all npm dependencies and run tests:
Piotr Gawron's avatar
Piotr Gawron committed
cd ~/workspace/minerva/frontend-js/
npm install
npm test
Piotr Gawron's avatar
Piotr Gawron committed
## Build
Piotr Gawron's avatar
Piotr Gawron committed
To build `*.war` file that can be deployed on tomcat you need to call ant maven-build task:
Piotr Gawron's avatar
Piotr Gawron committed
cd ~/workspace/minerva/
ant maven-build
Piotr Gawron's avatar
Piotr Gawron committed
This will create `~/workspace/minerva/web/target/web-1.0.war` file which can be deployed on tomcat:
Piotr Gawron's avatar
Piotr Gawron committed
cp ~/workspace/minerva/web/target/web-1.0.war $CATALINA_HOME/webapps/minerva.war
Piotr Gawron's avatar
Piotr Gawron committed
After starting tomcat you can access minerva using http://localhost:8080/minerva/.
Default credentials are:
Piotr Gawron's avatar
Piotr Gawron committed
login: admin
password: admin
Piotr Gawron's avatar
Piotr Gawron committed
## Deployment and release
Before making new release update [changelog file](https://git-r3lab.uni.lu/minerva/core/blob/master/CHANGELOG).
Piotr Gawron's avatar
Piotr Gawron committed

Piotr Gawron's avatar
Piotr Gawron committed
### Debian packages
When all the changes are ready tag commit and push it to the repository. Gitlab ci will execute unit tests and prepare distribution files that can be released. For now we release minerva using debian repository. Therefore gitlab ci creates a deb package (for instance: https://git-r3lab.uni.lu/minerva/core/-/jobs/29918). This package should be uploaded to our repository:
Piotr Gawron's avatar
Piotr Gawron committed
echo 'PUT minerva_12.0.3_amd64.deb'| sftp -P 8022 repo-r3lab.lcsb.uni.lu
ssh repo 'sudo reprepro -b /var/www/html/debian includedeb test minerva_12.0.3_amd64.deb'
Piotr Gawron's avatar
Piotr Gawron committed
Remember to use proper repository:
* stable - for production ready debian packages
* test - for packages that are ready to test and probably will be moved to stable soon
* experimental - for packages that might crash, can be unstable are created during development process (anything that has `alpha`, `beta` in the version number should be put here)
Piotr Gawron's avatar
Piotr Gawron committed
Moreover we store all debian packages on webdav:
Piotr Gawron's avatar
Piotr Gawron committed
echo 'put minerva_12.0.3_amd64.deb' | cadaver https://webdav-r3lab.uni.lu/public/minerva/
Piotr Gawron's avatar
Piotr Gawron committed
### Docker image
There is [Dockerfile]( https://git-r3lab.uni.lu/minerva/core/blob/master/Docker/Dockerfile) that allows to build Docker image from currently released debian package. After releasing debian package crete a Docker image and deploy it:
Piotr Gawron's avatar
Piotr Gawron committed
cd ~/workspace/minerva/Docker/
docker build --no-cache -t minerva .
Piotr Gawron's avatar
Piotr Gawron committed
Check list of docker images to find DOCKER ID
Piotr Gawron's avatar
Piotr Gawron committed
docker images
Piotr Gawron's avatar
Piotr Gawron committed
REPOSITORY     TAG           IMAGE ID            CREATED             SIZE
minerva        latest        26a9534e37ff        About an hour ago   1.223 GB
debian         jessie        bb5d89f9b6cb        13 days ago         125.1 MB
David Hoksza's avatar
David Hoksza committed
```
Piotr Gawron's avatar
Piotr Gawron committed
Tag docker image (assume that your docker ID is "26a9534e37ff" and version is 9999) and push it to repo:
David Hoksza's avatar
David Hoksza committed
```
Piotr Gawron's avatar
Piotr Gawron committed
docker tag 26a9534e37ff  docker-r3lab.uni.lu/minerva/minerva:9999
docker login https://docker-r3lab.uni.lu/
docker push docker-r3lab.uni.lu/minerva/minerva
Piotr Gawron's avatar
Piotr Gawron committed
### VirtualBox images
We provide also VirtualBox images with minerva installed  on it. Just create a new debian virtual box image and upload it to webdav:
Piotr Gawron's avatar
Piotr Gawron committed
echo 'put minerva-12.0.1_release.ova' | cadaver https://webdav-r3lab.uni.lu/public/minerva/
Piotr Gawron's avatar
Piotr Gawron committed
Image should have root account with `123qweasdzxc` password. It should also expose port 8080 on the host.