Skip to content

Commit

Permalink
Update InfluxDB 2.x to v2.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
kizniche committed Aug 8, 2024
1 parent 3b1c742 commit ed16127
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ This release changes the install directory from ~/Mycodo to /opt/Mycodo. This ne
- Add endpoint option to RAM Input for when Mycodo is using a non-standard IP/port
- Add self.control to the Python 3 Code Action
- Run widget HTML regeneration in thread
- Update InfluxDB 2.x to v2.7.8
- Update adafruit-circuitpython-ads1x15 to 2.2.25
- Update Gridstack to 10.0.1
- Update alembic to 1.13.1
Expand Down
27 changes: 14 additions & 13 deletions mycodo/scripts/upgrade_commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,12 @@ case "${1:-''}" in
printf "\n#### Ensuring compatible version of influxdb 2.x is installed ####\n"
if [[ ${UNAME_TYPE} == 'x86_64' || ${MACHINE_TYPE} == 'arm64' ]]; then
INSTALL_ADDRESS="https://dl.influxdata.com/influxdb/releases/"
AMD64_INSTALL_FILE="influxdb2_2.7.3-1_amd64.deb"
ARM64_INSTALL_FILE="influxdb2_2.7.3-1_arm64.deb"
AMD64_CLIENT_FILE="influxdb2-client-2.7.3-amd64.deb"
ARM64_CLIENT_FILE="influxdb2-client-2.7.3-arm64.deb"
CORRECT_VERSION="2.7.3-1"
AMD64_INSTALL_FILE="influxdb2_2.7.8-1_amd64.deb"
ARM64_INSTALL_FILE="influxdb2_2.7.8-1_arm64.deb"
CORRECT_VERSION_INSTALL="2.7.8-1"
AMD64_CLIENT_FILE="influxdb2-client-2.7.5-amd64.deb"
ARM64_CLIENT_FILE="influxdb2-client-2.7.5-arm64.deb"
CORRECT_VERSION_CLI="2.7.5-1"

if [[ ${UNAME_TYPE} == 'x86_64' ]]; then
printf "#### Detected x86_64 architecture\n"
Expand All @@ -457,42 +458,42 @@ case "${1:-''}" in

CURRENT_VERSION=$(apt-cache policy influxdb2 | grep 'Installed' | gawk '{print $2}')

if [[ "${CURRENT_VERSION}" != "${CORRECT_VERSION}" ]]; then
printf "#### Incorrect InfluxDB version (v${CURRENT_VERSION}) installed. Should be v${CORRECT_VERSION}\n"
if [[ "${CURRENT_VERSION}" != "${CORRECT_VERSION_INSTALL}" ]]; then
printf "#### Incorrect InfluxDB version (v${CURRENT_VERSION}) installed. Should be v${CORRECT_VERSION_INSTALL}\n"

printf "#### Stopping influxdb 1.x (if installed)...\n"
service influxdb stop

printf "#### Uninstalling influxdb 1.x (if installed)...\n"
DEBIAN_FRONTEND=noninteractive apt remove -y influxdb

printf "#### Installing InfluxDB v${CORRECT_VERSION}...\n"
printf "#### Installing InfluxDB v${CORRECT_VERSION_INSTALL}...\n"

wget --quiet "${INSTALL_ADDRESS}${INSTALL_FILE}"
dpkg -i "${INSTALL_FILE}"
rm -rf "${INSTALL_FILE}"

service influxd restart
else
printf "Correct version of InfluxDB currently installed (v${CORRECT_VERSION}).\n"
printf "Correct version of InfluxDB currently installed (v${CORRECT_VERSION_INSTALL}).\n"
fi

printf "#### Influxdb client file location: ${INSTALL_ADDRESS}${CLIENT_FILE}\n"

CURRENT_VERSION=$(apt-cache policy influxdb2-cli | grep 'Installed' | gawk '{print $2}')

if [[ "${CURRENT_VERSION}" != "${CORRECT_VERSION}" ]]; then
printf "#### Incorrect InfluxDB-Client version (v${CURRENT_VERSION}) installed. Should be v${CORRECT_VERSION}\n"
if [[ "${CURRENT_VERSION}" != "${CORRECT_VERSION_CLI}" ]]; then
printf "#### Incorrect InfluxDB-Client version (v${CURRENT_VERSION}) installed. Should be v${CORRECT_VERSION_CLI}\n"

printf "#### Installing InfluxDB-Client v${CORRECT_VERSION}...\n"
printf "#### Installing InfluxDB-Client v${CORRECT_VERSION_CLI}...\n"

wget --quiet "${INSTALL_ADDRESS}${CLIENT_FILE}"
dpkg -i "${CLIENT_FILE}"
rm -rf "${CLIENT_FILE}"

service influxd restart
else
printf "Correct version of InfluxDB-Client currently installed (v${CORRECT_VERSION}).\n"
printf "Correct version of InfluxDB-Client currently installed (v${CORRECT_VERSION_CLI}).\n"
fi
else
printf "ERROR: Could not detect 64-bit architecture (x86_64/arm64) to install Influxdb 2.x (found ${UNAME_TYPE}/${MACHINE_TYPE}).\n"
Expand Down

0 comments on commit ed16127

Please sign in to comment.