Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 11eada6

Browse files
Replace source with automatic MYSQL_ROOT_PASSWORD fetching
1 parent 2328bc7 commit 11eada6

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

‎bin/.config.sh‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ dockerContainerId() {
5858
}
5959

6060
dockerExec() {
61-
docker exec -i "$(docker-compose ps -q app)" $@
61+
docker exec -i "$(docker-compose ps -q app)" "$@"
6262
}
6363

6464
dockerExecMySQL() {
65-
docker exec -i "$(docker-compose ps -q mysql)" $@
65+
docker exec -i "$(docker-compose ps -q mysql)" "$@"
6666
}
6767

6868
dockerCopyFrom() {

‎bin/backup.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ case "1ドル" in
2626
fi
2727

2828
logMsg "Starting MySQL backup..."
29-
source"$(cd"$( dirname "${BASH_SOURCE[0]}")"&&pwd)/../etc/environment.yml"
29+
MYSQL_ROOT_PASSWORD=$(dockerExecMySQL bash -c 'printf $MYSQL_ROOT_PASSWORD')
3030
dockerExecMySQL mysqldump -h mysql -u root -p"${MYSQL_ROOT_PASSWORD}" --opt --single-transaction --events --all-databases --routines --comments | bzip2 > "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}"
3131
logMsg "Finished"
3232
else

‎bin/restore.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ case "1ドル" in
2222
if [[ -n "$(dockerContainerId mysql)" ]]; then
2323
if [ -f "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" ]; then
2424
logMsg "Starting MySQL restore..."
25-
source"$(cd"$( dirname "${BASH_SOURCE[0]}")"&&pwd)/../etc/environment.yml"
25+
MYSQL_ROOT_PASSWORD=$(dockerExecMySQL bash -c 'printf $MYSQL_ROOT_PASSWORD')
2626
bzcat "${BACKUP_DIR}/${BACKUP_MYSQL_FILE}" | dockerExecMySQL mysql -h mysql -u root -p"${MYSQL_ROOT_PASSWORD}"
2727
echo "FLUSH PRIVILEGES;" | dockerExec mysql -h mysql -u root -p"${MYSQL_ROOT_PASSWORD}"
2828
logMsg "Finished"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /