Skip to content
Snippets Groups Projects
Commit 30a1aaf4 authored by Stefano Di Frischia's avatar Stefano Di Frischia
Browse files

L2SS-966: dump configdb before updating

parent 3f600e1e
No related branches found
No related tags found
1 merge request!730L2SS-966: dump configdb before updating
...@@ -33,3 +33,5 @@ deploy/hosts ...@@ -33,3 +33,5 @@ deploy/hosts
docker-compose/alerta-web/alerta-secrets.json docker-compose/alerta-web/alerta-secrets.json
docker-compose/tmp docker-compose/tmp
**/CDB/dump*.json
...@@ -9,6 +9,14 @@ else ...@@ -9,6 +9,14 @@ else
exit 1 exit 1
fi fi
# dump a copy of the database before updating
# Do not change -i into -it this will break integration tests in gitlab ci!
docker exec -i dsconfig bash -c '
python -m dsconfig.dump > /tmp/dsconfig-configdb-dump.json
/manage_object_properties.py -r > /tmp/dsconfig-objectdb-dump.json
/merge_json.py /tmp/dsconfig-objectdb-dump.json /tmp/dsconfig-configdb-dump.json' \
> "${LOFAR20_DIR}"/CDB/dump_"$(date "+%Y.%m.%d_%H.%M.%S")".json
# copy file into container to read it from container, as the file's location # copy file into container to read it from container, as the file's location
# in the container won't be the same as on the host. # in the container won't be the same as on the host.
docker cp "${file}" dsconfig:/tmp/dsconfig-update-settings.json || exit 1 docker cp "${file}" dsconfig:/tmp/dsconfig-update-settings.json || exit 1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment