This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/dubbo-go-samples.git
commit e4ca19a73955d6a4343684c4f5d7c1e9049f8c6e Merge: 06a7cc0d 6676ea5f Author: Ken Liu <[email protected]> AuthorDate: Thu Mar 14 12:32:56 2024 +0800 Merge pull request #711 from YarBor/main Add config_yaml samples config_yaml/README.md | 235 +++++++++++++++++++++ config_yaml/README_zh.md | 233 ++++++++++++++++++++ config_yaml/go-client/cmd/main.go | 41 ++++ config_yaml/go-client/conf/dubbogo.yml | 15 ++ config_yaml/go-server/cmd/main.go | 50 +++++ config_yaml/go-server/conf/dubbogo.yml | 15 ++ config_yaml/proto/greet.pb.go | 230 ++++++++++++++++++++ config_yaml/proto/greet.proto | 34 +++ config_yaml/proto/greet.triple.go | 139 ++++++++++++ .../config_yaml/tests/integration/context_test.go | 37 ++++ .../config_yaml/tests/integration/main_test.go | 46 ++++ start_integrate_test.sh | 2 + 12 files changed, 1077 insertions(+) diff --cc start_integrate_test.sh index 34bff306,82ce1a49..1ace3758 --- a/start_integrate_test.sh +++ b/start_integrate_test.sh @@@ -114,26 -107,23 +114,28 @@@ array+=("compatibility/registry/service array+=("compatibility/registry/all/zookeeper") array+=("compatibility/registry/all/nacos") + # config yaml + array+=("config_yaml") # replace tls config echo "The prefix of certificate path of the following files were replaced to \"$(pwd)/tls\"." -find $(pwd)/tls -type f -name '*.yml' -print0 | xargs -0 -n1 -find $(pwd)/tls -type f -name '*.yml' -print0 | xargs -0 sed -i 's#\.\.\/\.\.\/\.\.#'"$(pwd)/tls"'#g' +find "$(pwd)/tls" -type f -name '*.yml' -print0 | xargs -0 -n1 +find "$(pwd)/tls" -type f -name '*.yml' -print0 | xargs -0 sed -i 's#\.\.\/\.\.\/\.\.#'"$(pwd)/tls"'#g' DOCKER_DIR=$(pwd)/integrate_test/dockercompose -docker-compose -f $DOCKER_DIR/docker-compose.yml up -d -bash -f $DOCKER_DIR/docker-health-check.sh -for ((i=0;i<${#array[*]};i++)) -do - ./integrate_test.sh "${array[i]}" - result=$? - if [ $result -gt 0 ]; then - docker-compose -f $DOCKER_DIR/docker-compose.yml down - exit $result - fi +DOCKER_COMPOSE_CMD="docker-compose" + +if [ "$(docker compose version > /dev/null; echo $?)" -eq 0 ]; then + DOCKER_COMPOSE_CMD="docker compose" +fi + +$DOCKER_COMPOSE_CMD -f "$DOCKER_DIR"/docker-compose.yml up -d +bash -f "$DOCKER_DIR"/docker-health-check.sh +for ((i = 0; i < ${#array[*]}; i++)); do + ./integrate_test.sh "${array[i]}" + result=$? + if [ $result -gt 0 ]; then + $DOCKER_COMPOSE_CMD -f "$DOCKER_DIR"/docker-compose.yml down + exit $result + fi done -docker-compose -f $DOCKER_DIR/docker-compose.yml down +$DOCKER_COMPOSE_CMD -f "$DOCKER_DIR"/docker-compose.yml down
