summaryrefslogtreecommitdiff
path: root/roles/contexts/fretlink/files/scripts/fl_restoreDump
blob: c76406b2f28dd232913e6c093dc7be1391a5fd99 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash

if [ -z "$1" ]; then
  echo "$(basename $0) zip-file-to-restore.zip"
  exit 1
fi

file=$(pwd)/$1

cd $HOME/workdir/app

unzip "$file"

source ../environment
mongorestore --drop --uri $FRETLINK_MONGO_URI $(pwd)/.dump/

if [ -e "../fixtures" ]; then
  source ../fixtures
fi