Skip to content

Commit 3628d40

Browse files
committed
chore: refactor external database configuration and installation logic
- Update the SCRIPT_COMMIT_SHA and SCRIPT_DATA comments in multiple scripts to reflect new values. - Replace existing external database configuration comments with EX_DB_ prefixed variables for clarity in multiple scripts. - Enhance the installation command logic to include additional external database parameters if provided. Signed-off-by: ysicing <i@ysicing.me>
1 parent aff1c81 commit 3628d40

3 files changed

Lines changed: 48 additions & 17 deletions

File tree

hack/scripts/devops/devops.sh

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
# Source code is available at https://github.com/easysoft/quickon_cli
99

10-
# SCRIPT_COMMIT_SHA="46bbc9273f52a922c6071d43dd1f7a7e538d8a81"
11-
# SCRIPT_DATA="Tue Jan 14 13:12:29 CST 2025"
10+
# SCRIPT_COMMIT_SHA="bd770bd54308aad22b2a2e3ee585c2693a49a6de"
11+
# SCRIPT_DATA="Thu Apr 3 11:27:15 CST 2025"
1212

1313
# Usage:
1414
# curl ... | ENV_VAR=... sh -
@@ -30,6 +30,19 @@
3030
# - STORAGE_TYPE
3131
# Storage Type when install Zentao DevOPS default use local as storage provider.
3232
# Defaults to '', support 'local', 'nfs'
33+
# - EX_DB_HOST
34+
# External Database Host when install Zentao DevOPS.
35+
# Defaults to ''
36+
# - EX_DB_PORT
37+
# External Database Port when install Zentao DevOPS.
38+
# Defaults to '3306'
39+
# - EX_DB_USER
40+
# External Database User when install Zentao DevOPS.
41+
# Defaults to ''
42+
# - EX_DB_PASSWORD
43+
# External Database Password when install Zentao DevOPS.
44+
# Defaults to ''
45+
3346

3447
set -e
3548
set -o noglob
@@ -208,6 +221,15 @@ install_zentao_devops() {
208221
if [ "${STORAGE_TYPE}" = "nfs" ]; then
209222
INSTALL_COMMAND="${INSTALL_COMMAND} --storage nfs"
210223
fi
224+
if [ -n "${EX_DB_HOST}" ] && [ -n "${EX_DB_PASSWORD}" ]; then
225+
INSTALL_COMMAND="${INSTALL_COMMAND} --ext-db-host ${EX_DB_HOST} --ext-db-password ${EX_DB_PASSWORD}"
226+
if [ -n "${EX_DB_PORT}" ] && [ "${EX_DB_PORT}" != "3306" ]; then
227+
INSTALL_COMMAND="${INSTALL_COMMAND} --ext-db-port ${EX_DB_PORT}"
228+
fi
229+
if [ -n "${EX_DB_USER}" ] && [ "${EX_DB_USER}" != "root" ]; then
230+
INSTALL_COMMAND="${INSTALL_COMMAND} --ext-db-user ${EX_DB_USER}"
231+
fi
232+
fi
211233
if [ -n "${DEBUG}" ]; then
212234
INSTALL_COMMAND="${INSTALL_COMMAND} --debug"
213235
fi

hack/scripts/devops/get.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
# Source code is available at https://github.com/easysoft/quickon_cli
99

10-
# SCRIPT_COMMIT_SHA="b617b5260d947c69caeafcfb89408e2b54d3d2a9"
10+
# SCRIPT_COMMIT_SHA="bd770bd54308aad22b2a2e3ee585c2693a49a6de"
1111
# SCRIPT_DATA="Wed Jan 8 16:02:39 CST 2025"
1212

1313
# Usage:

hack/scripts/devops/install.sh

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
# Source code is available at https://github.com/easysoft/quickon_cli
99

10-
# SCRIPT_COMMIT_SHA="46bbc9273f52a922c6071d43dd1f7a7e538d8a81"
11-
# SCRIPT_DATA="Tue Jan 14 13:12:29 CST 2025"
10+
# SCRIPT_COMMIT_SHA="bd770bd54308aad22b2a2e3ee585c2693a49a6de"
11+
# SCRIPT_DATA="Thu Apr 3 11:27:15 CST 2025"
1212

1313
# Usage:
1414
# curl ... | ENV_VAR=... sh -
@@ -30,18 +30,18 @@
3030
# - STORAGE_TYPE
3131
# Storage Type when install Zentao DevOPS default use local as storage provider.
3232
# Defaults to '', support 'local', 'nfs'
33-
# - EXTERNAL_HOST
34-
# external database host
35-
# - EXTERNAL_PORT
36-
# external database port
37-
# - EXTERNAL_ROOT_PASSWORD
38-
# external database root password
39-
# - EXTERNAL_USER
40-
# external database user
41-
# - EXTERNAL_PASSWORD
42-
# external database password
43-
# - EXTERNAL_DATABASE
44-
# external database name
33+
# - EX_DB_HOST
34+
# External Database Host when install Zentao DevOPS.
35+
# Defaults to ''
36+
# - EX_DB_PORT
37+
# External Database Port when install Zentao DevOPS.
38+
# Defaults to '3306'
39+
# - EX_DB_USER
40+
# External Database User when install Zentao DevOPS.
41+
# Defaults to ''
42+
# - EX_DB_PASSWORD
43+
# External Database Password when install Zentao DevOPS.
44+
# Defaults to ''
4545

4646
set -e
4747
set -o noglob
@@ -220,6 +220,15 @@ install_zentao_devops() {
220220
if [ "${STORAGE_TYPE}" = "nfs" ]; then
221221
INSTALL_COMMAND="${INSTALL_COMMAND} --storage nfs"
222222
fi
223+
if [ -n "${EX_DB_HOST}" ] && [ -n "${EX_DB_PASSWORD}" ]; then
224+
INSTALL_COMMAND="${INSTALL_COMMAND} --ext-db-host ${EX_DB_HOST} --ext-db-password ${EX_DB_PASSWORD}"
225+
if [ -n "${EX_DB_PORT}" ] && [ "${EX_DB_PORT}" != "3306" ]; then
226+
INSTALL_COMMAND="${INSTALL_COMMAND} --ext-db-port ${EX_DB_PORT}"
227+
fi
228+
if [ -n "${EX_DB_USER}" ] && [ "${EX_DB_USER}" != "root" ]; then
229+
INSTALL_COMMAND="${INSTALL_COMMAND} --ext-db-user ${EX_DB_USER}"
230+
fi
231+
fi
223232
if [ -n "${DEBUG}" ]; then
224233
INSTALL_COMMAND="${INSTALL_COMMAND} --debug"
225234
fi

0 commit comments

Comments
 (0)