Skip to content

Commit

Permalink
Allow intermediate steps
Browse files Browse the repository at this point in the history
  • Loading branch information
BYK authored Nov 1, 2024
1 parent 93a9a8c commit 9c02d78
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion install/upgrade-clickhouse.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ function wait_for_clickhouse() {
done
}

function get_clickhouse_version() {
$dc exec clickhouse clickhouse-client -q 'SELECT version()'
}


# First check to see if user is upgrading by checking for existing clickhouse volume
if [[ -n "$(docker volume ls -q --filter name=sentry-clickhouse)" ]]; then
# Start clickhouse if it is not already running
Expand All @@ -18,16 +23,24 @@ if [[ -n "$(docker volume ls -q --filter name=sentry-clickhouse)" ]]; then
wait_for_clickhouse

# In order to get to 24.3, we need to first upgrade go from 21.8 -> 22.8 -> 23.3 -> 23.8 -> 24.3
version=$($dc exec clickhouse clickhouse-client -q 'SELECT version()')
version=$(get_clickhouse_version)
if [[ "$version" == "21.8.13.1.altinitystable" || "$version" == "21.8.12.29.altinitydev.arm" ]]; then
$dc down clickhouse
$dcb --build-arg BASE_IMAGE=altinity/clickhouse-server:22.8.15.25.altinitystable clickhouse
$dc up -d clickhouse
wait_for_clickhouse
fi

version=$(get_clickhouse_version)
if [[ "$version" == "22.8.15.25.altinitystable" || "$version" == "22.8.15.25.altinitydev.arm" ]]; then
$dc down clickhouse
$dcb --build-arg BASE_IMAGE=altinity/clickhouse-server:23.3.19.33.altinitystable clickhouse
$dc up -d clickhouse
wait_for_clickhouse
fi

version=$(get_clickhouse_version)
if [[ "$version" == "23.3.19.33.altinitystable" || "$version" == "23.3.19.33.altinitydev.arm" ]]; then
$dc down clickhouse
$dcb --build-arg BASE_IMAGE=altinity/clickhouse-server:23.8.11.29.altinitystable clickhouse
$dc up -d clickhouse
Expand Down

0 comments on commit 9c02d78

Please sign in to comment.