(simatec) v0.9.4
This commit is contained in:
parent
4533351419
commit
bd4fc495d1
5 changed files with 120 additions and 0 deletions
|
@ -154,6 +154,9 @@ To leave the container on the console you have to execute 2x `exit`.
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### 0.9.4 (05.06.2024)
|
||||||
|
* (simatec) patch for Piler Update added
|
||||||
|
|
||||||
### 0.9.3 (01.06.2024)
|
### 0.9.3 (01.06.2024)
|
||||||
* (simatec) Piler v1.4.5 updated
|
* (simatec) Piler v1.4.5 updated
|
||||||
* (simatec) MariaDB v11.1.2 updated
|
* (simatec) MariaDB v11.1.2 updated
|
||||||
|
|
|
@ -4,6 +4,7 @@ services:
|
||||||
mysql:
|
mysql:
|
||||||
image: mariadb:${MARIA_DB_VERSION}
|
image: mariadb:${MARIA_DB_VERSION}
|
||||||
container_name: mysql_piler
|
container_name: mysql_piler
|
||||||
|
hostname: mysql
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
cap_drop:
|
cap_drop:
|
||||||
- ALL
|
- ALL
|
||||||
|
@ -31,6 +32,7 @@ services:
|
||||||
memcached:
|
memcached:
|
||||||
image: memcached:latest
|
image: memcached:latest
|
||||||
container_name: memcached
|
container_name: memcached
|
||||||
|
hostname: memcached
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
cap_drop:
|
cap_drop:
|
||||||
- ALL
|
- ALL
|
||||||
|
|
|
@ -24,6 +24,7 @@ services:
|
||||||
- DEFAULT_EMAIL=${LETSENCRYPT_EMAIL}
|
- DEFAULT_EMAIL=${LETSENCRYPT_EMAIL}
|
||||||
mysql:
|
mysql:
|
||||||
image: mariadb:${MARIA_DB_VERSION}
|
image: mariadb:${MARIA_DB_VERSION}
|
||||||
|
hostname: mysql
|
||||||
container_name: mysql-piler
|
container_name: mysql-piler
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
cap_drop:
|
cap_drop:
|
||||||
|
@ -52,6 +53,7 @@ services:
|
||||||
memcached:
|
memcached:
|
||||||
image: memcached:latest
|
image: memcached:latest
|
||||||
container_name: memcached-piler
|
container_name: memcached-piler
|
||||||
|
hostname: memcached
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
cap_drop:
|
cap_drop:
|
||||||
- ALL
|
- ALL
|
||||||
|
|
108
patch.sh
Normal file
108
patch.sh
Normal file
|
@ -0,0 +1,108 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Colors
|
||||||
|
if [ -z ${BASH_SOURCE} ]; then
|
||||||
|
blue=`echo "\e[1m\e[34m"`
|
||||||
|
green=`echo "\e[1m\e[32m"`
|
||||||
|
greenBold=`echo "\e[1m\e[1;32m"`
|
||||||
|
redBold=`echo "\e[1m\e[1;31m"`
|
||||||
|
red=`echo "\e[1m\e[31m"`
|
||||||
|
purple=`echo "\e[1m\e[35m"`
|
||||||
|
bold=`echo "\e[1m"`
|
||||||
|
normal=`echo "\e[0m"`
|
||||||
|
else
|
||||||
|
blue=`echo -e "\e[1m\e[34m"`
|
||||||
|
green=`echo -e "\e[1m\e[32m"`
|
||||||
|
greenBold=`echo -e "\e[1m\e[1;32m"`
|
||||||
|
redBold=`echo -e "\e[1m\e[1;31m"`
|
||||||
|
purple=`echo -e "\e[1m\e[35m"`
|
||||||
|
bold=`echo -e "\e[1m"`
|
||||||
|
normal=`echo -en "\e[0m"`
|
||||||
|
fi
|
||||||
|
|
||||||
|
HLINE="================================================================"
|
||||||
|
HLINE_SMALL="================================="
|
||||||
|
|
||||||
|
BLA_metro=( 0.2 ' ' '= ' '== ' '=== ' ' ===' ' ==' ' =' )
|
||||||
|
|
||||||
|
BLA::play_loading_animation_loop() {
|
||||||
|
while true ; do
|
||||||
|
for frame in "${BLA_active_loading_animation[@]}" ; do
|
||||||
|
printf "\r%s" "${frame}"
|
||||||
|
sleep "${BLA_loading_animation_frame_interval}"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
BLA::start_loading_animation() {
|
||||||
|
BLA_active_loading_animation=( "${@}" )
|
||||||
|
BLA_loading_animation_frame_interval="${BLA_active_loading_animation[0]}"
|
||||||
|
unset "BLA_active_loading_animation[0]"
|
||||||
|
tput civis # Hide the terminal cursor
|
||||||
|
BLA::play_loading_animation_loop &
|
||||||
|
BLA_loading_animation_pid="${!}"
|
||||||
|
}
|
||||||
|
|
||||||
|
BLA::stop_loading_animation() {
|
||||||
|
kill "${BLA_loading_animation_pid}" &> /dev/null
|
||||||
|
printf "\n"
|
||||||
|
tput cnorm # Restore the terminal cursor
|
||||||
|
}
|
||||||
|
|
||||||
|
#######################################################################################
|
||||||
|
|
||||||
|
echo
|
||||||
|
echo "${greenBold}${HLINE_SMALL}"
|
||||||
|
echo "Check if patches are available"
|
||||||
|
echo "${greenBold}${HLINE_SMALL}${normal}"
|
||||||
|
echo
|
||||||
|
|
||||||
|
#######################################################################################
|
||||||
|
|
||||||
|
# config load
|
||||||
|
. ./piler.conf
|
||||||
|
|
||||||
|
# Check Version
|
||||||
|
compare_versions() {
|
||||||
|
local version1=$1
|
||||||
|
local version2=$2
|
||||||
|
local ver1=$(echo "$version1" | awk -F. '{ printf("%03d%03d%03d", $1, $2, $3); }')
|
||||||
|
local ver2=$(echo "$version2" | awk -F. '{ printf("%03d%03d%03d", $1, $2, $3); }')
|
||||||
|
|
||||||
|
if [[ "$ver1" -ge "$ver2" ]]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
##################### Patch for Update to Piler v1.4.5 or higher ######################
|
||||||
|
# Check the manticore.conf to see if the entry "listen = 127.0.0.1:9307:mysql_readonly" is present.
|
||||||
|
# If the entry does not exist, set the entry in the manticore.conf
|
||||||
|
|
||||||
|
required_version="1.4.5"
|
||||||
|
|
||||||
|
if compare_versions "$PILER_VERSION" "$required_version"; then
|
||||||
|
file="/var/lib/docker/volumes/piler-docker_piler_etc/_data/manticore.conf"
|
||||||
|
patchNum="pilerPatch_001"
|
||||||
|
|
||||||
|
search_entry="127.0.0.1:9307:"
|
||||||
|
new_entry="${entry}\tlisten\t\t\t= 127.0.0.1:9307:mysql_readonly"
|
||||||
|
|
||||||
|
if [ -f $file ]; then
|
||||||
|
# Check the manticore.conf to see if the entry "listen = 127.0.0.1:9307:mysql_readonly" is present
|
||||||
|
if ! grep -qF "$search_entry" "$file"; then
|
||||||
|
# If the entry does not exist, set the entry in the manticore.conf
|
||||||
|
sed -i "/listen/!b; :a; {n; /listen/!ba}; a $new_entry" "$file"
|
||||||
|
sed -i "s/\<$patchNum\>//g" "$file"
|
||||||
|
echo "Patch manticore.conf with new entry: listen = 127.0.0.1:9307:mysql_readonly"
|
||||||
|
else
|
||||||
|
echo "Patch already executed. No action required"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "The file manticore.conf does not exist. The patch cannot be executed"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
#######################################################################################
|
||||||
|
|
||||||
|
exit 0
|
|
@ -204,6 +204,11 @@ if [ "$USE_LETSENCRYPT" = "yes" ]; then
|
||||||
else
|
else
|
||||||
cp $configPth/piler-default.yml $installPth/docker-compose.yml
|
cp $configPth/piler-default.yml $installPth/docker-compose.yml
|
||||||
fi
|
fi
|
||||||
|
# Check for Patches before Update
|
||||||
|
bash $installPth/patch.sh
|
||||||
|
BLA::start_loading_animation "${BLA_metro[@]}"
|
||||||
|
sleep 5
|
||||||
|
BLA::stop_loading_animation
|
||||||
|
|
||||||
# start Update Container
|
# start Update Container
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Reference in a new issue