|
@@ -2,10 +2,10 @@
|
|
|
|
|
|
# Проверяем наличие DB laboratory
|
|
# Проверяем наличие DB laboratory
|
|
if [[ $(mongo --host ${DB_CLUSTER} --quiet --eval "printjson(db.adminCommand('listDatabases'))"|grep -q "${MONGODB}";echo $?) -ne 0 ]];then
|
|
if [[ $(mongo --host ${DB_CLUSTER} --quiet --eval "printjson(db.adminCommand('listDatabases'))"|grep -q "${MONGODB}";echo $?) -ne 0 ]];then
|
|
- cd /tmp && tar xvf /opt/${MONGODB}.tar.gz
|
|
|
|
- mongorestore --host ${DB_CLUSTER} -d ${MONGODB} ${MONGODB}
|
|
|
|
- if [[ $? -ne 0 ]]; then echo "Database ${MONGODB} is not restored!!!";rm -rf /tmp/${MONGODB};exit 1;fi
|
|
|
|
- rm -rf /tmp/${MONGODB}
|
|
|
|
|
|
+ cd /tmp && tar xvf /opt/dev-${MONGODB}.tar.gz
|
|
|
|
+ mongorestore --host ${DB_CLUSTER} -d ${MONGODB} dev-${MONGODB}
|
|
|
|
+ if [[ $? -ne 0 ]]; then echo "Database ${MONGODB} is not restored!!!";rm -rf /tmp/dev-${MONGODB};exit 1;fi
|
|
|
|
+ rm -rf /tmp/dev-${MONGODB}
|
|
fi
|
|
fi
|
|
|
|
|
|
|
|
|