Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4c2f4b6

Browse files
committed
final fix for restore
If a mongo database is already present, mongorestore will fail, so we need to add --drop. And the rm -r kernelci is no longer necessary.
1 parent 0f268b3 commit 4c2f4b6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

restore.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ if [ ! -z "$DB_DUMP_FILE" ];then
4141

4242
## Restore dump
4343
echo "Restore $DB_DUMP_FILE"
44-
docker exec $ID /bin/bash -c "mongorestore --archive=/tmp/$DB_DUMP_FILE"
44+
docker exec $ID /bin/bash -c "mongorestore --archive=/tmp/$DB_DUMP_FILE --drop"
4545
if [ $? -ne 0 ];then
4646
exit 1
4747
fi
@@ -69,7 +69,6 @@ if [ ! -z "$LOG_DUMP_FILE" ];then
6969
-v $(pwd):/tmp/kernelci_logs/ \
7070
-v $VOLUMENAME:/var/lib/docker/volumes/kernelci_kci/_data \
7171
busybox cp -r /tmp/kernelci_logs/tmp/logs/. /var/lib/docker/volumes/kernelci_kci/_data
72-
rm -r kernel-ci/
7372
fi
7473

7574
exit 0

0 commit comments

Comments
 (0)