Skip to content

Commit

Permalink
Merge branch 'feature/postgres-repmgr_scripts' of github.com:ThomasRa…
Browse files Browse the repository at this point in the history
…smussen/bitnami-containers into feature/postgres-repmgr_scripts
  • Loading branch information
ThomasRasmussen committed Aug 16, 2024
2 parents 550afdd + 4074201 commit a1f2517
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
11 changes: 10 additions & 1 deletion bitnami/moodle/4.1/debian-12/rootfs/post-init.d/sql-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ else
. /opt/bitnami/scripts/liblog.sh
fi

MARIADB_HOST=${MARIADB_HOST:-$MOODLE_DATABASE_HOST}
MARIADB_PORT_NUMBER=${MARIADB_PORT_NUMBER:-$MOODLE_DATABASE_PORT_NUMBER}
MARIADB_ROOT_USER=${MARIADB_ROOT_USER:-$MOODLE_DATABASE_USER}
MARIADB_DATABASE=${MARIADB_DATABASE:-$MOODLE_DATABASE_NAME}
if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then
MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD:-$MOODLE_DATABASE_PASSWORD}
fi

mysql_execute() {
local -r sql_file="${1:?missing file}"
local failure=0
mysql_cmd=("mysql" "-h" "$MARIADB_HOST" "-P" "$MARIADB_PORT_NUMBER" "-u" "$MARIADB_ROOT_USER")
mysql_cmd=("mysql" "-h" "$MARIADB_HOST" "-P" "$MARIADB_PORT_NUMBER" "-u" "$MARIADB_ROOT_USER" "-D" "${MARIADB_DATABASE}")
if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then
mysql_cmd+=("-p${MARIADB_ROOT_PASSWORD}")
fi
Expand All @@ -33,6 +41,7 @@ mysql_execute() {
return "$failure"
}


# Loop through all input files passed via stdin
read -r -a custom_init_scripts <<< "$@"
failure=0
Expand Down
11 changes: 10 additions & 1 deletion bitnami/moodle/4.2/debian-12/rootfs/post-init.d/sql-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ else
. /opt/bitnami/scripts/liblog.sh
fi

MARIADB_HOST=${MARIADB_HOST:-$MOODLE_DATABASE_HOST}
MARIADB_PORT_NUMBER=${MARIADB_PORT_NUMBER:-$MOODLE_DATABASE_PORT_NUMBER}
MARIADB_ROOT_USER=${MARIADB_ROOT_USER:-$MOODLE_DATABASE_USER}
MARIADB_DATABASE=${MARIADB_DATABASE:-$MOODLE_DATABASE_NAME}
if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then
MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD:-$MOODLE_DATABASE_PASSWORD}
fi

mysql_execute() {
local -r sql_file="${1:?missing file}"
local failure=0
mysql_cmd=("mysql" "-h" "$MARIADB_HOST" "-P" "$MARIADB_PORT_NUMBER" "-u" "$MARIADB_ROOT_USER")
mysql_cmd=("mysql" "-h" "$MARIADB_HOST" "-P" "$MARIADB_PORT_NUMBER" "-u" "$MARIADB_ROOT_USER" "-D" "${MARIADB_DATABASE}")
if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then
mysql_cmd+=("-p${MARIADB_ROOT_PASSWORD}")
fi
Expand All @@ -33,6 +41,7 @@ mysql_execute() {
return "$failure"
}


# Loop through all input files passed via stdin
read -r -a custom_init_scripts <<< "$@"
failure=0
Expand Down
11 changes: 10 additions & 1 deletion bitnami/moodle/4.3/debian-12/rootfs/post-init.d/sql-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ else
. /opt/bitnami/scripts/liblog.sh
fi

MARIADB_HOST=${MARIADB_HOST:-$MOODLE_DATABASE_HOST}
MARIADB_PORT_NUMBER=${MARIADB_PORT_NUMBER:-$MOODLE_DATABASE_PORT_NUMBER}
MARIADB_ROOT_USER=${MARIADB_ROOT_USER:-$MOODLE_DATABASE_USER}
MARIADB_DATABASE=${MARIADB_DATABASE:-$MOODLE_DATABASE_NAME}
if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then
MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD:-$MOODLE_DATABASE_PASSWORD}
fi

mysql_execute() {
local -r sql_file="${1:?missing file}"
local failure=0
mysql_cmd=("mysql" "-h" "$MARIADB_HOST" "-P" "$MARIADB_PORT_NUMBER" "-u" "$MARIADB_ROOT_USER")
mysql_cmd=("mysql" "-h" "$MARIADB_HOST" "-P" "$MARIADB_PORT_NUMBER" "-u" "$MARIADB_ROOT_USER" "-D" "${MARIADB_DATABASE}")
if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then
mysql_cmd+=("-p${MARIADB_ROOT_PASSWORD}")
fi
Expand All @@ -33,6 +41,7 @@ mysql_execute() {
return "$failure"
}


# Loop through all input files passed via stdin
read -r -a custom_init_scripts <<< "$@"
failure=0
Expand Down
11 changes: 10 additions & 1 deletion bitnami/moodle/4.4/debian-12/rootfs/post-init.d/sql-mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ else
. /opt/bitnami/scripts/liblog.sh
fi

MARIADB_HOST=${MARIADB_HOST:-$MOODLE_DATABASE_HOST}
MARIADB_PORT_NUMBER=${MARIADB_PORT_NUMBER:-$MOODLE_DATABASE_PORT_NUMBER}
MARIADB_ROOT_USER=${MARIADB_ROOT_USER:-$MOODLE_DATABASE_USER}
MARIADB_DATABASE=${MARIADB_DATABASE:-$MOODLE_DATABASE_NAME}
if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then
MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD:-$MOODLE_DATABASE_PASSWORD}
fi

mysql_execute() {
local -r sql_file="${1:?missing file}"
local failure=0
mysql_cmd=("mysql" "-h" "$MARIADB_HOST" "-P" "$MARIADB_PORT_NUMBER" "-u" "$MARIADB_ROOT_USER")
mysql_cmd=("mysql" "-h" "$MARIADB_HOST" "-P" "$MARIADB_PORT_NUMBER" "-u" "$MARIADB_ROOT_USER" "-D" "${MARIADB_DATABASE}")
if [[ "${ALLOW_EMPTY_PASSWORD:-no}" != "yes" ]]; then
mysql_cmd+=("-p${MARIADB_ROOT_PASSWORD}")
fi
Expand All @@ -33,6 +41,7 @@ mysql_execute() {
return "$failure"
}


# Loop through all input files passed via stdin
read -r -a custom_init_scripts <<< "$@"
failure=0
Expand Down

0 comments on commit a1f2517

Please sign in to comment.