summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2018-12-11 10:02:01 +0100
committerCorentin LABBE <clabbe@baylibre.com>2018-12-11 10:07:16 +0100
commit5787bbd116b65d4be872dcca76d0049899a53a2d (patch)
treec19f547aeed7d25074030db9f245954afb3c7ea5
parent2bd0840b929f31506c0dc19eb0d9a92975f004bc (diff)
lava-master: use /root/backup/ for storing backups
For storing backups to be restored, it is better to use /root/backup/ instead of /
-rw-r--r--lava-master/Dockerfile2
-rwxr-xr-xlava-master/scripts/setup.sh11
2 files changed, 7 insertions, 6 deletions
diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile
index fb28bc9..9de656f 100644
--- a/lava-master/Dockerfile
+++ b/lava-master/Dockerfile
@@ -1,6 +1,6 @@
FROM baylibre/lava-master-base:latest
-COPY backup /
+COPY backup /root/backup/
COPY configs/tftpd-hpa /etc/default/tftpd-hpa
diff --git a/lava-master/scripts/setup.sh b/lava-master/scripts/setup.sh
index 34cd0a1..9864ad2 100755
--- a/lava-master/scripts/setup.sh
+++ b/lava-master/scripts/setup.sh
@@ -7,18 +7,19 @@ fi
sudo -u postgres psql -c "ALTER USER lavaserver WITH PASSWORD '$(cat /root/pg_lava_password)';" || exit $?
sed -i "s,^LAVA_DB_PASSWORD=.*,LAVA_DB_PASSWORD='$(cat /root/pg_lava_password)'," /etc/lava-server/instance.conf || exit $?
-if [ -e /db_lavaserver.gz ];then
- gunzip /db_lavaserver.gz || exit $?
+if [ -e /root/backup/db_lavaserver.gz ];then
+ gunzip /root/backup/db_lavaserver.gz || exit $?
fi
-if [ -e /db_lavaserver ];then
+if [ -e /root/backup/db_lavaserver ];then
echo "Restore database from backup"
- sudo -u postgres psql < /db_lavaserver || exit $?
+ sudo -u postgres psql < /root/backup/db_lavaserver || exit $?
lava-server manage migrate || exit $?
echo "Restore jobs output from backup"
rm -r /var/lib/lava-server/default/media/job-output/*
- tar xzf /joboutput.tar.gz || exit $?
+ tar xzf /root/backup/joboutput.tar.gz || exit $?
fi
+
chown -R lavaserver:lavaserver /var/lib/lava-server/default/media/job-output/
# default site is set as example.com