-
Notifications
You must be signed in to change notification settings - Fork 7
/
run_project
executable file
·43 lines (40 loc) · 1.4 KB
/
run_project
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
#!/usr/bin/env bash
# Columnstore Team Use Only
# shellcheck source=/dev/null
source .env
USE_COMPOSE=${USE_COMPOSE:-true}
MAXSCALE=${MAXSCALE:-false}
PM1=${PM1:-mcs1}
PM2=${PM2:-mcs2}
PM3=${PM3:-mcs3}
MCS_IMAGE_NAME=${MCS_IMAGE_NAME:-mariadb/columnstore}
USE_S3_STORAGE=${USE_S3_STORAGE:-false}
S3_ACCESS_KEY_ID=${S3_ACCESS_KEY_ID:-myaccesskey}
S3_SECRET_ACCESS_KEY=${S3_SECRET_ACCESS_KEY:-mysecretkey}
S3_BUCKET=${S3_BUCKET:-mybucket}
S3_ENDPOINT=${S3_ENDPOINT:-s3.amazonaws.com}
S3_REGION=${S3_REGION:-us-west-2}
if [[ "${USE_COMPOSE}" == true ]]; then
if [[ "${MAXSCALE}" == true ]]; then
docker compose -f docker-compose-mxs.yml up -d
docker exec -it "${PM1}" provision "${PM1}" "${PM2}" "${PM3}"
else
docker compose -f docker-compose.yml up -d
docker exec -it "${PM1}" provision "${PM1}" "${PM2}" "${PM3}"
fi
else
docker run -d \
--name "${PM1}" \
--hostname "${PM1}" \
--env PM1="${PM1}" \
--env USE_S3_STORAGE="${USE_S3_STORAGE}" \
--env S3_ACCESS_KEY_ID="${S3_ACCESS_KEY_ID}" \
--env S3_SECRET_ACCESS_KEY="${S3_SECRET_ACCESS_KEY}" \
--env S3_BUCKET="${S3_BUCKET}" \
--env S3_ENDPOINT="${S3_ENDPOINT}" \
--env S3_REGION="${S3_REGION}" \
--env CGROUP="${CGROUP}" \
-p 127.0.0.1:3307:3306 \
--shm-size=512mb "${MCS_IMAGE_NAME}"
docker exec -it "${PM1}" provision "${PM1}"
fi