Skip to content

Commit

Permalink
Fix bug 365 (#367)
Browse files Browse the repository at this point in the history
* Update .goreleaser.yaml (#362)

* fix bug: read port information from the configuration file.

Signed-off-by: skiffer-git <[email protected]>

---------

Signed-off-by: skiffer-git <[email protected]>
Co-authored-by: Xinwei Xiong <[email protected]>
  • Loading branch information
skiffer-git and cubxxw committed Jan 4, 2024
1 parent cf7462c commit c9b5b98
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 11 deletions.
27 changes: 26 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,36 @@

before:
hooks:
- make clean
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
- go generate ./...


git:
# What should be used to sort tags when gathering the current and previous
# tags if there are more than one tag in the same commit.
#
# Default: '-version:refname'
tag_sort: -version:creatordate

# What should be used to specify prerelease suffix while sorting tags when gathering
# the current and previous tags if there are more than one tag in the same commit.
#
# Since: v1.17
prerelease_suffix: "-"

# Tags to be ignored by GoReleaser.
# This means that GoReleaser will not pick up tags that match any of the
# provided values as either previous or current tags.
#
# Templates: allowed.
# Since: v1.21.
ignore_tags:
- nightly
# - "{{.Env.IGNORE_TAG}}"

report_sizes: true

builds:
Expand Down Expand Up @@ -467,4 +492,4 @@ release:
# announce:
# slack:
# enabled: false
# message_template: "slack {{ .Tag }} is out! Check it out: https://github.com/OpenIMSDK/Open-IM-Server/releases/tag/{{ .Tag }}"
# message_template: "slack {{ .Tag }} is out! Check it out: https://github.com/OpenIMSDK/Open-IM-Server/releases/tag/{{ .Tag }}"
38 changes: 28 additions & 10 deletions scripts/check_all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,41 @@ service_port_name=(
openImChatPort
)
sleep 10
switch=$(cat $config_path | grep demoswitch |awk -F '[:]' '{print $NF}')
for i in ${service_port_name[*]}; do


# Define the path to the configuration YAML file
config_yaml="$OPENIM_ROOT/config/config.yaml" # Replace with the actual path to your YAML file


# Function to extract a value from the YAML file and remove any leading/trailing whitespace
extract_yaml_value() {
local key=$1
grep -oP "${key}: \[\s*\K[^\]]+" "$config_yaml" | xargs
}

# Extract port numbers from the YAML configuration
openImChatApiPort=$(extract_yaml_value 'openImChatApiPort')
openImAdminApiPort=$(extract_yaml_value 'openImAdminApiPort')
openImAdminPort=$(extract_yaml_value 'openImAdminPort')
openImChatPort=$(extract_yaml_value 'openImChatPort')

for i in "${service_port_name[@]}"; do
case $i in
"openImChatApiPort")
new_service_name="chat-api"
new_service_port="10008"
new_service_port=$openImChatApiPort
;;
"openImAdminApiPort")
new_service_name="admin-rpc"
new_service_port="30200"
new_service_name="admin-api"
new_service_port=$openImAdminApiPort
;;
"openImAdminPort")
new_service_name="chat-rpc"
new_service_port="30300"
new_service_name="admin-rpc"
new_service_port=$openImAdminPort
;;
"openImChatPort")
new_service_name="admin-api"
new_service_port="10009"
new_service_name="chat-rpc"
new_service_port=$openImChatPort
;;
*)
echo "Invalid service name: $i"
Expand All @@ -78,4 +95,5 @@ for i in ${service_port_name[*]}; do
else
echo -e "${new_service_port}${GREEN_PREFIX} port has been listening, belongs service is ${i}${COLOR_SUFFIX}"
fi
done
done

0 comments on commit c9b5b98

Please sign in to comment.