diff --git a/.gitignore b/.gitignore index 69b645a3cb3acf07db16f42fdaa8396627d583fa..95968218c813af7e5461d064a864d4b93d8cefd6 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,5 @@ deploy/hosts docker-compose/alerta-web/alerta-secrets.json docker-compose/tmp + +**/CDB/dump*.json diff --git a/sbin/update_ConfigDb.sh b/sbin/update_ConfigDb.sh index a8fab09f7846a5dc354f35e5cd58f4483833c970..4e3fc4b210e1bcc2b299e51521cb9e92b94377b4 100755 --- a/sbin/update_ConfigDb.sh +++ b/sbin/update_ConfigDb.sh @@ -9,6 +9,14 @@ else exit 1 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 # in the container won't be the same as on the host. docker cp "${file}" dsconfig:/tmp/dsconfig-update-settings.json || exit 1