From b4b97dada358c261c263fc770586cffbe15be501 Mon Sep 17 00:00:00 2001 From: Pierre Boutillier Date: Tue, 26 Feb 2019 18:34:30 +0100 Subject: [PATCH] Fix identity.json preservation in docker images after a reset --- scripts/docker/entrypoint.inc.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/docker/entrypoint.inc.sh b/scripts/docker/entrypoint.inc.sh index d3c33b96f..f514d4ee6 100644 --- a/scripts/docker/entrypoint.inc.sh +++ b/scripts/docker/entrypoint.inc.sh @@ -58,15 +58,16 @@ launch_node() { fi if [ "$local_data_version" != "$image_version" ]; then echo "Removing outdated chain data..." - if [ -f "$node_data_dir/identities.json" ]; then \ - mv "$node_data_dir/identities.json" /tmp + if [ -f "$node_data_dir/identity.json" ]; then \ + mv "$node_data_dir/identity.json" /tmp fi rm -rf "$node_data_dir" rm -rf "$client_dir/blocks" rm -rf "$client_dir/nonces" rm -rf "$client_dir/endorsements" - if [ -f "/tmp/identities.json" ]; then \ - mv /tmp/identities.json "$node_data_dir/" + if [ -f "/tmp/identity.json" ]; then \ + mkdir -p "$node_data_dir" + mv /tmp/identity.json "$node_data_dir/" fi cp "/usr/local/share/tezos/alphanet_version" \ "$node_dir/alphanet_version"