mirror of
https://git.rwth-aachen.de/acs/public/villas/web/
synced 2025-03-09 00:00:01 +01:00
add some sample data and a script to save / restore it
This commit is contained in:
parent
5640b01bbf
commit
2b2052e203
5 changed files with 31 additions and 2 deletions
|
@ -3,6 +3,7 @@ image: docker:17
|
|||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: normal
|
||||
DOCKER_COMPOSE_VERSION: 1.13.0
|
||||
DOCKER_DRIVER: overlay
|
||||
|
||||
services:
|
||||
- docker:dind
|
||||
|
|
|
@ -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
|
||||
|
|
BIN
VILLAS.archive
Normal file
BIN
VILLAS.archive
Normal file
Binary file not shown.
|
@ -38,6 +38,8 @@ services:
|
|||
user: mongodb
|
||||
volumes:
|
||||
- database:/data/db
|
||||
expose:
|
||||
- "27017"
|
||||
restart: always
|
||||
user: mongodb
|
||||
networks:
|
||||
|
|
25
sample-data.sh
Executable file
25
sample-data.sh
Executable file
|
@ -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
|
||||
|
Loading…
Add table
Reference in a new issue