-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename update.sql, fix sorting bug, move conifg updates to pre_update…
… since pio command needs to know this config, and python scripts that import pioreactor need to know too
- Loading branch information
1 parent
22b0e00
commit 2ef93a3
Showing
7 changed files
with
56 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#!/bin/bash | ||
|
||
set -xeu | ||
|
||
|
||
export LC_ALL=C | ||
|
||
# Lower bound version | ||
min_version="24.12.5" | ||
|
||
# Get the current version of pio | ||
current_version=$(sudo -u pioreactor pio version) | ||
|
||
# Use sorting to determine if the current version is less than the minimum version | ||
is_valid=$(printf "%s\n%s" "$current_version" "$min_version" | sort -V | head -n1) | ||
|
||
# If the smallest version isn't the minimum version, then current version is too low | ||
if [ "$is_valid" != "$min_version" ]; then | ||
sudo -u pioreactor pio log -l ERROR -m "Version error: installed version $current_version is lower than the minimum required version $min_version." | ||
exit 1 | ||
fi | ||
|
||
echo "Version check passed: $current_version" | ||
|
||
|
||
|
||
LEADER_HOSTNAME=$(crudini --get /home/pioreactor/.pioreactor/config.ini cluster.topology leader_hostname) | ||
|
||
|
||
# we need this config for downstream updates, so set it now. | ||
if [ "$HOSTNAME" = "$LEADER_HOSTNAME" ]; then | ||
|
||
crudini --set /home/pioreactor/.pioreactor/config.ini storage temporary_cache /tmp/pioreactor_cache/local_intermittent_pioreactor_metadata.sqlite \ | ||
--set /home/pioreactor/.pioreactor/config.ini storage persistent_cache /home/pioreactor/.pioreactor/storage/local_persistent_pioreactor_metadata.sqlite | ||
|
||
sudo -u pioreactor pios sync-configs --shared || : | ||
|
||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.