Skip to content

Latest commit

 

History

History
94 lines (48 loc) · 2.78 KB

README.md

File metadata and controls

94 lines (48 loc) · 2.78 KB

Liipi - Park and Ride API Build Status Coverage Status

HSL open source project to collect and share parking capacity information.

The service can be found at https://p.hsl.fi

API documentation can be found at https://p.hsl.fi/docs

Development

To build the project, you will need Docker. For development outside Docker, you will also need Java 8, Maven, Node.js and Yarn.

Building the project

docker-compose build

Starting the application

docker-compose up -d db api web

The web application will run on http://localhost:8080 and the PostgreSQL database on localhost:5432

Running UI tests

docker-compose run --rm test

Tagging the temporary Docker containers which were used for building the app, so that the dependency cache will survive docker image prune

./cache-builder-images.sh 

Running tests against PostgreSQL (after caching builder images)

docker-compose up -d db
docker run --rm -v "$PWD:/project" --network host liipi-api-builder-cache mvn clean verify -P psql

Developing locally, outside Docker

Build the API backend

mvn clean verify

The test output will be saved in target/surefire-reports

Run tests against PostgreSQL (default is H2)

mvn clean verify -P psql

Build the web frontend

cd web
yarn install
yarn run build

Developer version of the web frontend, proxying the API backend in port 8080 on the host machine (running in your IDE). The web application will run on http://localhost:8081

docker-compose up -d webdev

TODO: There is some live reloading support in the old Grunt build (yarn run autobuild), but it doesn't work properly. Grunt is outdated, so consider upgrading to Webpack and webpack-dev-server.

Running UI tests locally

Preparations

cd test
yarn install
yarn run webdriver-update
yarn run webdriver-start

Running tests

yarn run test

Running only some tests

yarn run test --specs specs/auth/auth.spec.js

Deployment

Publish the latest built images as version 123

./publish.sh 123

License

Copyright © 2015-2018 HSL

The source code of this program is dual-licensed under the EUPL v1.2 and AGPLv3 licenses.

The data hosted in this service is licensed under the CC BY 4.0 license.