Skip to content

feat: minimal bk support#77

Open
shpdnkti wants to merge 2 commits intoTencentBlueKing:ft_minimal_bkfrom
shpdnkti:ft_minimal_bk
Open

feat: minimal bk support#77
shpdnkti wants to merge 2 commits intoTencentBlueKing:ft_minimal_bkfrom
shpdnkti:ft_minimal_bk

Conversation

@shpdnkti
Copy link
Contributor

No description provided.

shpdnkti added 2 commits April 7, 2024 18:48
update

update

* refactor(create_swap.sh): remove vm.swappiness and vm.vfs_cache_pressure system configurations from script
@shpdnkti shpdnkti changed the base branch from master to ft_minimal_bk April 22, 2024 07:20
@shpdnkti shpdnkti changed the title feat: minimal bk support #76 feat: minimal bk support Apr 22, 2024
@shpdnkti shpdnkti linked an issue Apr 22, 2024 that may be closed by this pull request
if [ -f "$SWAP_PATH" ]; then
swapoff -v "$SWAP_PATH"
rm -f "$SWAP_PATH"
sed -i.$(date +%F) "\@$SWAP_PATH@d" /etc/fstab

Check warning

Code scanning / shellcheck

Quote this to prevent word splitting.

Quote this to prevent word splitting.
-p | --port )
shift
PORT=$1
PORTS=( $1 )

Check warning

Code scanning / shellcheck

Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.

Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.
if ! [[ "$PORT" =~ [0-9]+ ]]; then # 其实要判断是否在1<port<65545之间
warning "redis_cluster 的端口不是字符串"

if [[ -z ${PORTS[@]} ]];then

Check failure

Code scanning / shellcheck

Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).

Arrays implicitly concatenate in [[ ]]. Use a loop (or explicit * instead of @).
if [[ $(ss -tnl4 | awk -v addr="^${BIND_ADDR}:${PORT}$" '$4 ~ addr' | wc -l) -ge 1 ]]; then
warning "${BIND_ADDR}:${PORT} 已经监听,请确认"
fi
for port in ${PORTS[@]}; do

Check failure

Code scanning / shellcheck

Double quote array expansions to avoid re-splitting elements.

Double quote array expansions to avoid re-splitting elements.
CONF_NAME=${NAME}.conf
log "生成 /etc/redis/$CONF_NAME 配置文件"
cat > /etc/redis/"${CONF_NAME}" <<EOF
for port in ${PORTS[@]}; do

Check failure

Code scanning / shellcheck

Double quote array expansions to avoid re-splitting elements.

Double quote array expansions to avoid re-splitting elements.
local module=log
local target_name=$(map_module_name $module)
source <(/opt/py36/bin/python ${SELF_DIR}/qq.py -p ${BK_PKG_SRC_PATH}/${target_name}/projects.yaml -P ${SELF_DIR}/bin/default/port.yaml)
projects=${_projects[${module}]}

Check warning

Code scanning / shellcheck

Variable was used as an array but is now assigned a string.

Variable was used as an array but is now assigned a string.

for project in ${projects[@]}; do
IFS="," read -r -a target_server<<<${_project_ip["${target_name},${project}"]}
for ip in ${target_server[@]}; do

Check failure

Code scanning / shellcheck

Double quote array expansions to avoid re-splitting elements.

Double quote array expansions to avoid re-splitting elements.

case $module in
paas|license|cmdb|job|gse|yum|consul|pypi|bkenv|rabbitmq|zk|mongodb|influxdb|license|cert|nginx|usermgr|appo|bklog|es7|python|appt|kafka|beanstalk|fta|dbcheck|controller|lesscode|node|bkapi|apigw|etcd|apisix|redis_cluster)
install_"${module}" $@

Check failure

Code scanning / shellcheck

Double quote array expansions to avoid re-splitting elements.

Double quote array expansions to avoid re-splitting elements.

sed -i '/gunicorn/s/-w [0-9][0-9]/-w 2/' $BK_PKG_SRC_PATH/fta/support-files/templates/#etc#supervisor-fta-fta.conf
sed -i '/gunicorn wsgi/s/-w [0-9][0-9]/-w 2/' $BK_PKG_SRC_PATH/usermgr/support-files/templates/#etc#supervisor-usermgr-api.conf
for m in ${module[@]}; do

Check failure

Code scanning / shellcheck

Double quote array expansions to avoid re-splitting elements.

Double quote array expansions to avoid re-splitting elements.
sed -i '/gunicorn/s/-w [0-9][0-9]/-w 2/' $BK_PKG_SRC_PATH/fta/support-files/templates/#etc#supervisor-fta-fta.conf
sed -i '/gunicorn wsgi/s/-w [0-9][0-9]/-w 2/' $BK_PKG_SRC_PATH/usermgr/support-files/templates/#etc#supervisor-usermgr-api.conf
for m in ${module[@]}; do
tweak_$m

Check notice

Code scanning / shellcheck

Double quote to prevent globbing and word splitting.

Double quote to prevent globbing and word splitting.
@shpdnkti shpdnkti self-assigned this Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: minimal bk support

1 participant