Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoknoll committed Jan 4, 2017
1 parent d5d6485 commit fb174da
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 130 deletions.
12 changes: 12 additions & 0 deletions .idea/schulcloud.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ while getopts "hp:c:U:P:H:D:" opt; do
;;

p)
BACKUP_PATH="$OPTARG"
BACKUP_PATH_PREFIX="$OPTARG"
;;

c)
Expand Down Expand Up @@ -78,11 +78,10 @@ if [ -z "$HOST" ]; then
HOST="localhost:27017"
fi

echo $BACKUP_PATH

if [ -z "$BACKUP_PATH" ]; then
BACKUP_PATH="backup"
if [ -z "$BACKUP_PATH_PREFIX" ]; then
BACKUP_PATH_PREFIX=$(date +%Y_%m_%d_%H_%M_%S)
fi
BACKUP_PATH="backup/""$BACKUP_PATH_PREFIX"


ARGS=""
Expand Down Expand Up @@ -111,7 +110,7 @@ if [ "$ACTION" = "export" ]; then
pushd $BACKUP_PATH 2>/dev/null

for collection in $DATABASE_COLLECTIONS; do
mongoexport --host $HOST $ARGS --db $DB --collection $collection --pretty --out $collection.json >/dev/null
mongoexport --host $HOST $ARGS --db $DB --collection $collection --pretty --jsonArray --out $collection.json >/dev/null
done

elif [ "$ACTION" = "import" ]; then
Expand All @@ -121,7 +120,7 @@ elif [ "$ACTION" = "import" ]; then
for path in *.json; do
collection=${path%.json}
echo "Importing $DB/$collection from $path"
mongoimport --host $HOST $ARGS --db $DB --collection $collection $path --drop
mongoimport --host $HOST $ARGS --db $DB --collection $collection $path --jsonArray --drop
done

else
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
"scripts": {
"lint": "eslint ./src ./test --ext .js",
"test": "npm run lint && npm run coverage",
"backup": "./backup.sh export",
"setup": "./backup.sh -p setup/ import",
"start": "node src/",
"startd": "nodemon src/",
"coverage": "NODE_ENV=test istanbul cover node_modules/.bin/_mocha -- -- -u exports -R spec test/**/*.test.js",
Expand Down
2 changes: 0 additions & 2 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ const bodyParser = require('body-parser');
const socketio = require('feathers-socketio');
const middleware = require('./middleware');
const services = require('./services');
const setupEnvironment = require('./setupEnvironment');
const winston = require('winston');
const defaultHeaders = require('./middleware/defaultHeaders');
const setupSwagger = require('./swagger');
Expand Down Expand Up @@ -42,6 +41,5 @@ app.use(compress())
winston.cli(); // optimize for cli, like using colors
winston.level = 'debug';
winston.info('test');
setupEnvironment(app).setup();

module.exports = app;
121 changes: 0 additions & 121 deletions src/setupEnvironment.js

This file was deleted.

0 comments on commit fb174da

Please sign in to comment.