fix(sentry-data): Don't migrate when not needed (#297)
With this patch, `./install.sh` becomes safer as it won't recursively move things under `/data/file`. It also won't try to migrate an empty volume.
This commit is contained in:
parent
4af4ecfd0e
commit
3c9e8c28ff
@ -130,9 +130,12 @@ until $(docker-compose run --rm clickhouse clickhouse-client -h clickhouse --que
|
||||
done;
|
||||
echo ""
|
||||
|
||||
SENTRY_DATA_NEEDS_MIGRATION=$(docker run --rm -v sentry-data:/data alpine ash -c "[ ! -d '/data/files' ] && ls -A1x /data | wc -l")
|
||||
if [ "$SENTRY_DATA_NEEDS_MIGRATION" ]; then
|
||||
echo "Migrating file storage..."
|
||||
docker run --rm -v sentry-data:/data alpine ash -c \
|
||||
"mkdir -p /tmp/files; mv /data/* /tmp/files/; mv /tmp/files /data/files"
|
||||
fi
|
||||
|
||||
cleanup
|
||||
|
||||
|
Reference in New Issue
Block a user