fix build path in copy.sh is chosen randomly

This commit is contained in:
Kedi Yang
2023-11-11 17:56:52 +08:00
parent 6b9fac55ca
commit 0a85b00bcb
2 changed files with 36 additions and 11 deletions

View File

@ -34,7 +34,7 @@ function obd_exec {
}
alias obd="obd_exec"
function variables_parpare {
function variables_prepare {
if [[ "$(readlink -f "$BASE_DIR"/..)" == "$OB_FLOW_WORK_DIR" ]]
then
path=$(readlink -f "$BASE_DIR")
@ -47,7 +47,7 @@ function variables_parpare {
DATA_PATH="/data/$(whoami)"
IPADDRESS="127.0.0.1"
if [[ -f "$BASE_DIR/.ce" ]]
then
then
export IS_CE=1
COMPONENT="oceanbase-ce"
else
@ -74,7 +74,7 @@ function variables_parpare {
function copy_sh {
if [[ -f copy.sh ]]
then
sh copy.sh
sh copy.sh $BUILD_PATH
else
echo 'can not find copy.sh'
fi
@ -559,11 +559,11 @@ Usage: $entrance <command> [options]
Available commands:
prepare [-p DATA_PATH -h HOST] Prepare for deployment.
prepare [-b BUILD_PATH -p DATA_PATH -h HOST] Prepare for deployment.
deploy -c YAML_CONF [-n DEPLOY_NAME] Deploy a cluster by a deploy yaml file. Default deploy name will be the name of yaml file.
redeploy [-c YAML_CONF -n DEPLOY_NAME] Redeploy cluster.
redeploy [-c YAML_CONF -n DEPLOY_NAME] Redeploy cluster.
reinstall [-n DEPLOY_NAME] Reinstall cluster. (Change bin file, sync libs and restart)
start [-n DEPLOY_NAME] Start cluster.
start [-n DEPLOY_NAME] Start cluster.
stop [-n DEPLOY_NAME] Stop a started cluster.
restart [-n DEPLOY_NAME] Restart cluster.
destroy [-n DEPLOY_NAME] Destroy cluster.
@ -593,20 +593,21 @@ Options:
-n DEPLOY_NAME, --deploy-name DEPLOY_NAME
The name of the deployment.
-v VERBOSE Activate verbose output.
-b BUILD_PATH, --build-path BUILD_PATH The build path of oceanbase.
-p DATA_PATH, --data-path DATA_PATH The data path for server deployment, it can be changed in the yaml file.
--ip IPADDRESS The ipaddress for server deployment, it can be changed in the yaml file.
--port PORT_BEGIN The port starting point. All the ports can be changed in the yaml file.
--with-local-obproxy Use local obproxy.
--skip-copy Skip copy.sh.
--cp Exec copy.sh.
--reboot Redeploy cluster before mysqltest
--reboot Redeploy cluster before mysqltest.
"""
}
function main() {
entrance=${OBD_SH_ENTRANCE:-obd.sh}
variables_parpare
variables_prepare
command="$1"
shift
extra_args=""
@ -625,6 +626,7 @@ function main() {
fi
;;
-n | --deploy-name ) DEPLOY_NAME="$2"; shift 2 ;;
-b | --build-path ) BUILD_PATH="$2"; shift 2 ;;
-p | --data-path ) DATA_PATH="$2"; shift 2 ;;
-N ) NO_CONFIRM="1"; shift ;;
--ip ) IPADDRESS="$2"; shift 2 ;;
@ -645,6 +647,7 @@ function main() {
YAML_CONF=$(absolute_path ${YAML_CONF})
DATA_PATH=$(absolute_path ${DATA_PATH})
BUILD_PATH=$(absolute_path ${BUILD_PATH})
OBSERVER_PATH=$(absolute_path ${OBSERVER_PATH})
if [[ "$MINI" == "1" && "$DISABLE_REBOOT" != "1" ]]
@ -733,7 +736,7 @@ function main() {
mirror_create && reinstall_cluster
;;
list)
obd cluster list
obd cluster list
;;
edit)
edit