forked from openedx-unsupported/devstack
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprovision.sh
More file actions
executable file
·76 lines (56 loc) · 1.58 KB
/
provision.sh
File metadata and controls
executable file
·76 lines (56 loc) · 1.58 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/env bash
# This script will provision all of the services. Each service will be setup in the following manner:
#
# 1. Migrations run,
# 2. Tenants—as in multi-tenancy—setup,
# 3. Service users and OAuth clients setup in LMS,
# 4. Static assets compiled/collected.
set -e
set -o pipefail
set -x
source .env
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
if [ "$MOUNT_TYPE" = "-nfs" ]; then
./setup_native_nfs_docker_osx.sh
fi
# Bring the databases online.
docker compose up -d mysql mongo
# Ensure the MySQL server is online and usable
echo "Waiting for MySQL"
until docker exec -i edx.devstack.mysql mysql -uroot -se "SELECT EXISTS(SELECT 1 FROM mysql.user WHERE user = 'root')" &> /dev/null
do
printf "."
sleep 1
done
# In the event of a fresh MySQL container, wait a few seconds for the server to restart
# This can be removed once https://github.com/docker-library/mysql/issues/245 is resolved.
sleep 10
printf "Creating mongo usres"
docker exec -i edx.devstack.mongo mongosh < mongo-provision.js
echo -e "MySQL ready"
if $ENABLE_EDX; then
./provision-lms.sh
# Nothing special needed for studio
#docker compose `echo ${DOCKER_COMPOSE_FILES}` up -d studio
fi
if $ENABLE_PROGS; then
echo "** Programs **"
./provision-progs.sh
fi
if $ENABLE_B2B; then
echo "** B2B **"
./provision-b2b.sh
fi
if $ENABLE_MKTG; then
echo "** Marketing **"
./provision-mktg.sh
fi
if $ENABLE_STATE_MANAGER; then
echo "** State Manager **"
./provision-state-manager-api.sh
fi
docker image prune -f
echo -e "${GREEN}Provisioning complete!${NC}"