summaryrefslogtreecommitdiffstats
path: root/lava-master/entrypoint.d/01_setup.sh
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2020-06-01 13:36:38 +0200
committerCorentin LABBE <clabbe@baylibre.com>2020-06-01 13:36:38 +0200
commit85f3c0d8274ef32865d00bf670277dcc69563f43 (patch)
treea7749e51c3f2555df2cb70a0c4cda6583b69f676 /lava-master/entrypoint.d/01_setup.sh
parent9596a7d56f8e4b6653ae1735075b3fc95b268fe9 (diff)
Support 2020.05
LAVA has changed the place of DB password from instance.conf to a yaml file.
Diffstat (limited to 'lava-master/entrypoint.d/01_setup.sh')
-rwxr-xr-xlava-master/entrypoint.d/01_setup.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/lava-master/entrypoint.d/01_setup.sh b/lava-master/entrypoint.d/01_setup.sh
index 5e437ef..53db47e 100755
--- a/lava-master/entrypoint.d/01_setup.sh
+++ b/lava-master/entrypoint.d/01_setup.sh
@@ -5,7 +5,13 @@ if [ ! -e /root/pg_lava_password ];then
< /dev/urandom tr -dc A-Za-z0-9 | head -c16 > /root/pg_lava_password
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 /etc/lava-server/instance.conf ];then
+ # pre 2020.05
+ sed -i "s,^LAVA_DB_PASSWORD=.*,LAVA_DB_PASSWORD='$(cat /root/pg_lava_password)'," /etc/lava-server/instance.conf || exit $?
+else
+ # 2020.05+
+ sed -i "s,PASSWORD:.*,PASSWORD: '$(cat /root/pg_lava_password)'," /etc/lava-server/settings.d/00-database.yaml || exit $?
+fi
if [ -e /root/backup/db_lavaserver.gz ];then
gunzip /root/backup/db_lavaserver.gz || exit $?