-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
322 additions
and
80 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
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
File renamed without changes.
File renamed without changes.
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
32 changes: 32 additions & 0 deletions
32
10.1/root/usr/share/container-scripts/mysql/init/50-passwd-change.sh
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,32 @@ | ||
password_change() { | ||
log_info 'Setting passwords ...' | ||
|
||
# Set the password for MySQL user and root everytime this container is started. | ||
# This allows to change the password by editing the deployment configuration. | ||
if [[ -v MYSQL_USER && -v MYSQL_PASSWORD ]]; then | ||
mysql $mysql_flags <<EOSQL | ||
SET PASSWORD FOR '${MYSQL_USER}'@'%' = PASSWORD('${MYSQL_PASSWORD}'); | ||
EOSQL | ||
fi | ||
|
||
# The MYSQL_ROOT_PASSWORD is optional, therefore we need to either enable remote | ||
# access with a password if the variable is set or disable remote access otherwise. | ||
if [ -v MYSQL_ROOT_PASSWORD ]; then | ||
# create a user if it doesn't exist and set its password | ||
mysql $mysql_flags <<EOSQL | ||
CREATE USER IF NOT EXISTS 'root'@'%'; | ||
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '${MYSQL_ROOT_PASSWORD}' WITH GRANT OPTION; | ||
EOSQL | ||
else | ||
mysql $mysql_flags <<EOSQL | ||
DROP USER IF EXISTS 'root'@'%'; | ||
FLUSH PRIVILEGES; | ||
EOSQL | ||
fi | ||
} | ||
|
||
if ! [ -v MYSQL_RUNNING_AS_SLAVE ] ; then | ||
password_change | ||
fi | ||
|
||
unset -f password_change |
23 changes: 0 additions & 23 deletions
23
10.1/root/usr/share/container-scripts/mysql/passwd-change.sh
This file was deleted.
Oops, something went wrong.
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
3 changes: 3 additions & 0 deletions
3
10.1/root/usr/share/container-scripts/mysql/pre-init/30-base-config.sh
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,3 @@ | ||
log_info 'Processing basic MySQL configuration files ...' | ||
envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/my-base.cnf.template > /etc/my.cnf.d/base.cnf | ||
|
16 changes: 16 additions & 0 deletions
16
10.1/root/usr/share/container-scripts/mysql/pre-init/60-replication-config.sh
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,16 @@ | ||
# mysqld configuration for replication scenarios | ||
|
||
if [ -v MYSQL_RUNNING_AS_MASTER ] || [ -v MYSQL_RUNNING_AS_SLAVE ] ; then | ||
log_info 'Processing basic MySQL configuration for replication (master and slave) files ...' | ||
envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/my-repl-gtid.cnf.template > /etc/my.cnf.d/repl-gtid.cnf | ||
fi | ||
|
||
if [ -v MYSQL_RUNNING_AS_MASTER ] ; then | ||
log_info 'Processing basic MySQL configuration for replication (master only) files ...' | ||
envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/my-master.cnf.template > /etc/my.cnf.d/master.cnf | ||
fi | ||
|
||
if [ -v MYSQL_RUNNING_AS_SLAVE ] ; then | ||
log_info 'Processing basic MySQL configuration for replication (slave only) files ...' | ||
envsubst < ${CONTAINER_SCRIPTS_PATH}/pre-init/my-slave.cnf.template > /etc/my.cnf.d/slave.cnf | ||
fi |
5 changes: 5 additions & 0 deletions
5
10.1/root/usr/share/container-scripts/mysql/pre-init/70-s2i-config.sh
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,5 @@ | ||
# additional arbitrary mysqld configuration provided by user using s2i | ||
|
||
log_info 'Processing additional arbitrary MySQL configuration provided by s2i ...' | ||
|
||
process_extending_config_files ${APP_DATA}/mysql-cfg/ ${CONTAINER_SCRIPTS_PATH}/cnf/ |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,12 @@ | ||
#!/bin/bash | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
shopt -s dotglob | ||
echo "---> Installing application source ..." | ||
ls -A /tmp/src/* &>/dev/null && mv /tmp/src/* ./ | ||
|
||
# Fix source directory permissions | ||
fix-permissions ./ |
Oops, something went wrong.