Fix identity.json preservation in docker images after a reset

This commit is contained in:
Pierre Boutillier 2019-02-26 18:34:30 +01:00
parent c80ab66397
commit b4b97dada3
No known key found for this signature in database
GPG Key ID: C2F73508B56A193C

View File

@ -58,15 +58,16 @@ launch_node() {
fi fi
if [ "$local_data_version" != "$image_version" ]; then if [ "$local_data_version" != "$image_version" ]; then
echo "Removing outdated chain data..." echo "Removing outdated chain data..."
if [ -f "$node_data_dir/identities.json" ]; then \ if [ -f "$node_data_dir/identity.json" ]; then \
mv "$node_data_dir/identities.json" /tmp mv "$node_data_dir/identity.json" /tmp
fi fi
rm -rf "$node_data_dir" rm -rf "$node_data_dir"
rm -rf "$client_dir/blocks" rm -rf "$client_dir/blocks"
rm -rf "$client_dir/nonces" rm -rf "$client_dir/nonces"
rm -rf "$client_dir/endorsements" rm -rf "$client_dir/endorsements"
if [ -f "/tmp/identities.json" ]; then \ if [ -f "/tmp/identity.json" ]; then \
mv /tmp/identities.json "$node_data_dir/" mkdir -p "$node_data_dir"
mv /tmp/identity.json "$node_data_dir/"
fi fi
cp "/usr/local/share/tezos/alphanet_version" \ cp "/usr/local/share/tezos/alphanet_version" \
"$node_dir/alphanet_version" "$node_dir/alphanet_version"