diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 179e421..bc32ecc 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ image: docker:17 variables: GIT_SUBMODULE_STRATEGY: normal DOCKER_COMPOSE_VERSION: 1.13.0 + DOCKER_DRIVER: overlay services: - docker:dind diff --git a/README.md b/README.md index dceeb9e..793013d 100644 --- a/README.md +++ b/README.md @@ -27,12 +27,13 @@ $ git clone --recursive git@git.rwth-aachen.de:VILLASframework/VILLASweb.git $ npm install $ npm build $ docker-compose up +$ ./sample-data.sh import ``` -To start the website locally run `npm start`. This will open a local webserver serving the _frontend_. To make the website work, you still need to start at least the VILLASweb-backend (See repository for information). - The default user and password are configured in the `config.js` file of the _backend_. By default they are: __admin__ / __admin__. +For development you can use `npm start` to spawn a local webserver. + ## Copyright 2017, Institute for Automation of Complex Power Systems, EONERC diff --git a/VILLAS.archive b/VILLAS.archive new file mode 100644 index 0000000..0167f76 Binary files /dev/null and b/VILLAS.archive differ diff --git a/docker-compose.yml b/docker-compose.yml index 9bc0d4a..d89820c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -38,6 +38,8 @@ services: user: mongodb volumes: - database:/data/db + expose: + - "27017" restart: always user: mongodb networks: diff --git a/sample-data.sh b/sample-data.sh new file mode 100755 index 0000000..b0e4aec --- /dev/null +++ b/sample-data.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +DIR=$(basename $(pwd)) + +ACTION=${1:-import} +CONTAINER=${2:-${DIR}_database_1} +NETWORK=${4:-${DIR}_villas} +DATABASE=${3:-VILLAS} + +DOCKEROPTS="--interactive --tty --rm --network ${NETWORK} --volume $(pwd):/tmp" + +case ${ACTION} in + import) + docker run ${DOCKEROPTS} mongo:latest bash -c 'mongorestore --verbose --host '${CONTAINER}' --gzip --archive=/tmp/'${DATABASE}'.archive' + ;; + + save) + docker run ${DOCKEROPTS} mongo:latest bash -c 'mongodump --verbose --host '${CONTAINER}' --db '${DATABASE}' --gzip --archive=/tmp/'${DATABASE}'.archive' + ;; + + *) + echo "Usage: $0 (import|save) [MONGODB_CONTAINER [DATABASE [NETWORK]]]" + ;; +esac +