FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
devstack/update-dbs-init-sql-scripts.sh at master · openedx-unsupported/devstack · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
This repository was archived by the owner on Aug 1, 2024. It is now read-only.
openedx-unsupported
/
devstack
Public archive
Notifications
You must be signed in to change notification settings
Fork
400
Star
405
Code
Issues
19
Pull requests
29
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
devstack
/
update-dbs-init-sql-scripts.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
37 lines (31 loc) · 1.45 KB
Breadcrumbs
devstack
/
update-dbs-init-sql-scripts.sh
Copy path
File metadata and controls
executable file
·
37 lines (31 loc) · 1.45 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!
/usr/bin/env bash
#
Updates MySQL databases dumps with MySQL Docker container schema/data
#
Make sure you have added your user to the docker group before running this script
#
or use sudo to run it
set
-eu -o pipefail
set
-x
#
constants
readonly
EDXAPP_MYSQL_DB_USER=
"
edxapp001
"
readonly
ECOMMERCE_MYSQL_DB_USER=
"
ecomm001
"
readonly
MYSQL_DB_PASSWORD=
"
password
"
readonly
EDXAPP_DBS=(
"
edxapp
"
"
edxapp_csmh
"
)
DBS=(
"
ecommerce
"
"
${EDXAPP_DBS[@]}
"
)
#
don't include the demo course in the initial sql since it relies on data being present in mongo
export
DEVSTACK_SKIP_DEMO=
"
true
"
#
create a docker devstack with LMS and ecommerce
make destroy
make dev.clone.ssh
make dev.pull.lms+ecommerce
make dev.provision.services.lms+ecommerce
#
dump schema and data from mysql databases in the mysql docker container and copy them to current directory in docker host
MYSQL_DOCKER_CONTAINER=
"
$(
make --silent --no-print-directory dev.print-container.mysql80
)
"
for
DB_NAME
in
"
${DBS[@]}
"
;
do
DB_CREATION_SQL_SCRIPT=
"
${DB_NAME}
.sql
"
if
[[
"
${EDXAPP_DBS[@]}
"
=~
"
${DB_NAME}
"
]]
;
then
MYSQL_DB_USER=
${EDXAPP_MYSQL_DB_USER}
else
MYSQL_DB_USER=
${ECOMMERCE_MYSQL_DB_USER}
fi
docker
exec
${MYSQL_DOCKER_CONTAINER}
/bin/bash -c
"
mysqldump -u
${MYSQL_DB_USER}
-p
${MYSQL_DB_PASSWORD}
--no-tablespaces --add-drop-database --skip-add-drop-table --databases
${DB_NAME}
>
${DB_CREATION_SQL_SCRIPT}
"
docker cp
${MYSQL_DOCKER_CONTAINER}
:/
${DB_CREATION_SQL_SCRIPT}
.
done
Back
|
FazBrowse Home
|
New Git URL