Skip to content

Commit 9605eba

Browse files
add default values for ob-configserver env vars (#17)
1 parent 261f85e commit 9605eba

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

ob-configserver/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
44

55
ARG VERSION
66
ARG TARGETPLATFORM
7-
RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]] ; then yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/ob-configserver-${VERSION}.el8.x86_64.rpm ; else yum install -y http://mirrors.aliyun.com/oceanbase/community/stable/el/8/aarch64/ob-configserver-${VERSION}.el8.aarch64.rpm ; fi
7+
RUN if [[ ${TARGETPLATFORM} == 'linux/amd64' ]] ; then rpm -ivh http://mirrors.aliyun.com/oceanbase/community/stable/el/8/x86_64/ob-configserver-${VERSION}.el8.x86_64.rpm ; else rpm -ivh http://mirrors.aliyun.com/oceanbase/community/stable/el/8/aarch64/ob-configserver-${VERSION}.el8.aarch64.rpm ; fi
88
ADD config.yaml.template /home/admin/ob-configserver/conf/
9+
ADD env.sh /home/admin/ob-configserver
910
ADD start.sh /home/admin/ob-configserver
1011
WORKDIR /home/admin/ob-configserver
1112

ob-configserver/env.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export DATABASE_TYPE=${MODE:-sqlite3}
2+
export SVC_ADDRESS=${SVC_ADDRESS:-$(hostname -i)}
3+
export SVC_PORT=${SVC_PORT:-8080}

ob-configserver/start.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
source env.sh
4+
35
if [[ "$DATABASE_TYPE" == "mysql" ]]; then
46
echo 'use mysql'
57
sed -e "s/\${SVC_ADDRESS}/${SVC_ADDRESS}/" -e "s/\${SVC_PORT}/${SVC_PORT}/" -e "s/\${DATABASE_TYPE}/${DATABASE_TYPE}/" -e "s/\${META_USER}/${META_USER}/" -e "s/\${META_PASSWORD}/${META_PASSWORD}/" -e "s/\${META_HOST}/${META_HOST}/" -e "s/\${META_PORT}/${META_PORT}/" -e "s/\${META_DATABASE}/${META_DATABASE}/" ./conf/config.yaml.template | grep -v '#CONFIG_FOR_SQLITE' > ./conf/config.yaml

0 commit comments

Comments
 (0)