Skip to content

Commit

Permalink
fix: some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
aronchanisme committed Aug 28, 2024
1 parent 200aa90 commit 4d16e5a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 0 deletions.
15 changes: 15 additions & 0 deletions bin/basic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,19 @@ function check_cron_service()
return 1
fi
fi
}

# function: get local timezone setting
function get_tz()
{

}

# function: check if cron is enabled
function basic()
{
func_name=$1
option_1=$2
option_2=$3
${func_name} ${option_1} ${option_2}
}
5 changes: 5 additions & 0 deletions bin/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ function build_image()

add_log "D" "sed -i 's#FROM ubuntu:22.04#FROM ccr.ccs.tencentyun.com/mo-infra/ubuntu:22.04#g' optools/images/Dockerfile"
sed -i 's#FROM ubuntu:22.04#FROM ccr.ccs.tencentyun.com/mo-infra/ubuntu:22.04#g' optools/images/Dockerfile

add_log "D" "sed -i 's#FROM golang:1.23.0-bookworm#FROM ccr.ccs.tencentyun.com/mo-infra/golang:1.23.0-bookworm#g' optools/images/Dockerfile"
sed -i 's#FROM golang:1.23.0-bookworm#FROM ccr.ccs.tencentyun.com/mo-infra/golang:1.23.0-bookworm#g' optools/images/Dockerfile


fi


Expand Down
6 changes: 6 additions & 0 deletions bin/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ function start()
cmd_params="${cmd_params} --privileged=true"
fi

if [[ "${MO_CONTAINER_TIMEZONE}" == "host" ]]; then
cmd_params="${cmd_params} -v /etc/localtime:/etc/localtime"
fi

debug_option=""
if [[ "${MO_CONTAINER_DEBUG_PORT}" != "" ]]; then
debug_option="-debug-http :${MO_CONTAINER_DEBUG_PORT}"
Expand All @@ -117,6 +121,8 @@ function start()
pprof_option="-profile-interval ${PPROF_INTERVAL}s"
fi



# if conf path exists
if [[ -d ${MO_CONTAINER_CONF_HOST_PATH} ]]; then
docker_init_cmd="docker run ${cmd_params} -v ${MO_CONTAINER_CONF_HOST_PATH}:/etc:rw --entrypoint /mo-service ${MO_CONTAINER_IMAGE} ${debug_option} ${pprof_option} -launch ${MO_CONTAINER_CONF_CON_FILE}"
Expand Down
2 changes: 2 additions & 0 deletions conf/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ MO_CONTAINER_EXTRA_MOUNT_OPTION=""
# replace below image repo with ccr.ccs.tencentyun.com/mo-infra? option: yes | no
# images: golang:1.22.3-bookworm , ubuntu:22.04
MO_CONTAINER_DEPIMAGE_REPLACE_REPO="yes"
# timezone, choose from: default(usually UTC) | host (same as host local time)
MO_CONTAINER_TIMEZONE="default"


###########################################
Expand Down
3 changes: 3 additions & 0 deletions mo_ctl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ function main()
"monitor")
monitor "${option_2}" "${option_3}"
;;
"basic")
basic "${option_2}" "${option_3}" "${option_4}"
;;
*)
add_log "E" "Invalid option_1: ${option_1}, please refer to usage help info below"
help_1
Expand Down

0 comments on commit 4d16e5a

Please sign in to comment.