diff --git a/.github/workflows/example.yml b/.github/workflows/example.yml new file mode 100644 index 00000000..fcc0a4dd --- /dev/null +++ b/.github/workflows/example.yml @@ -0,0 +1,63 @@ +name: Release + +on: + workflow_dispatch: + inputs: + subdir: + description: 'Subdirectory' + required: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Setup JDK 8 + uses: AdoptOpenJDK/install-jdk@v1 + with: + version: '8' + architecture: x64 + targets: 'JAVA_8_HOME' + + - name: Setup JDK 11 + uses: AdoptOpenJDK/install-jdk@v1 + with: + version: '11' + architecture: x64 + targets: 'JAVA_11_HOME' + + - name: Setup JDK 17 + uses: AdoptOpenJDK/install-jdk@v1 + with: + version: '17' + architecture: x64 + targets: 'JAVA_17_HOME;JAVA_HOME' + + - name: Install xmllint + run: sudo apt-get install libxml2-utils + + - name: Get version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + with: + config-inline: | + insecure-entitlements = [ "network.host" ] + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.POLARIS_DOCKER_NAME }} + password: ${{ secrets.POLARIS_DOCKER_PASSWORD }} + + - name: Build + id: build + run: | + export use_docker_env=false + pushd polaris-agent-build/bin + bash ./build.sh + bash ./build_example_docker.sh ${{ github.event.inputs.subdir }} + diff --git a/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/consumer/src/main/resources/polaris.yml b/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/consumer/src/main/resources/polaris.yml new file mode 100644 index 00000000..58dd214d --- /dev/null +++ b/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/consumer/src/main/resources/polaris.yml @@ -0,0 +1,8 @@ +consumer: + serviceRouter: + plugin: + # 设置就近路由插件配置 + nearbyBasedRouter: + # 描述:就近路由的最小匹配级别,需要显示设置 + # 范围: zone(腾讯云地域信息,eg: ap-guangzhou)、campus(腾讯云可用区, eg: ap-guangzhou-3) + matchLevel: campus diff --git a/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-a/src/main/resources/application.properties b/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-a/src/main/resources/application.properties index 42b40fef..e804caa8 100644 --- a/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-a/src/main/resources/application.properties +++ b/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-a/src/main/resources/application.properties @@ -1,5 +1,9 @@ -spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 +server.port=65001 +spring.application.name=service-provider-hoxton +spring.cloud.nacos.config.server-addr=127.0.0.1:8848 +spring.cloud.nacos.config.enabled=false spring.cloud.nacos.discovery.enabled=false - +spring.cloud.nacos.username=nacos +spring.cloud.nacos.password=nacos management.endpoints.web.exposure.include=* management.endpoint.health.show-details=always \ No newline at end of file diff --git a/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-a/src/main/resources/bootstrap.properties b/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-a/src/main/resources/bootstrap.properties deleted file mode 100644 index 12871448..00000000 --- a/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-a/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,7 +0,0 @@ -server.port=65001 -spring.application.name=service-provider-hoxton -spring.cloud.nacos.config.server-addr=127.0.0.1:8848 -spring.cloud.nacos.config.enabled=false -spring.cloud.nacos.discovery.enabled=false -spring.cloud.nacos.username=nacos -spring.cloud.nacos.password=nacos diff --git a/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-b/src/main/resources/application.properties b/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-b/src/main/resources/application.properties index 42b40fef..181a4c2d 100644 --- a/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-b/src/main/resources/application.properties +++ b/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-b/src/main/resources/application.properties @@ -1,5 +1,9 @@ -spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 +server.port=65004 +spring.application.name=service-provider-hoxton +spring.cloud.nacos.config.server-addr=127.0.0.1:8848 +spring.cloud.nacos.config.enabled=false spring.cloud.nacos.discovery.enabled=false - +spring.cloud.nacos.username=nacos +spring.cloud.nacos.password=nacos management.endpoints.web.exposure.include=* management.endpoint.health.show-details=always \ No newline at end of file diff --git a/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-b/src/main/resources/bootstrap.properties b/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-b/src/main/resources/bootstrap.properties deleted file mode 100644 index 8c4c0863..00000000 --- a/polaris-agent-examples/spring-cloud-plugins-examples/spring-cloud-hoxton-examples/quickstart-examples/provider-b/src/main/resources/bootstrap.properties +++ /dev/null @@ -1,7 +0,0 @@ -server.port=65004 -spring.application.name=service-provider-hoxton -spring.cloud.nacos.config.server-addr=127.0.0.1:8848 -spring.cloud.nacos.config.enabled=false -spring.cloud.nacos.discovery.enabled=false -spring.cloud.nacos.username=nacos -spring.cloud.nacos.password=nacos diff --git a/polaris-agent-plugins/spring-cloud-plugins/spring-cloud-hoxton-plugin/src/main/conf/plugin/spring-cloud-hoxton/application.properties b/polaris-agent-plugins/spring-cloud-plugins/spring-cloud-hoxton-plugin/src/main/conf/plugin/spring-cloud-hoxton/application.properties index 5f8f2517..4c757a94 100644 --- a/polaris-agent-plugins/spring-cloud-plugins/spring-cloud-hoxton-plugin/src/main/conf/plugin/spring-cloud-hoxton/application.properties +++ b/polaris-agent-plugins/spring-cloud-plugins/spring-cloud-hoxton-plugin/src/main/conf/plugin/spring-cloud-hoxton/application.properties @@ -1,7 +1,7 @@ # the application name for spring cloud, register as the service name in registry center -spring.application.name=service-consumer-H +spring.application.name=service-consumer-hoxton # polaris server address -spring.cloud.polaris.address=grpc\://111.230.207.241\:8091 +spring.cloud.polaris.address=grpc\://127.0.0.1\:8091 # switch for spring cloud polaris all features spring.cloud.polaris.enabled=true # switch for spring cloud discovery feature @@ -22,6 +22,9 @@ spring.cloud.polaris.router.rule-router.enabled=true spring.cloud.polaris.router.metadata-router.enabled=true # switch for polaris router(nearby-router) feature spring.cloud.polaris.router.nearby-router.enabled=true +# switch for circuitbreaker +spring.cloud.polaris.circuitbreaker.enabled=true +feign.hystrix.enabled=true # switch for polaris ratelimit feature spring.cloud.polaris.ratelimit.enabled=false # rejectHttpCode for polaris ratelimit, will be returned as limited @@ -39,4 +42,4 @@ spring.cloud.polaris.stat.port=0 # path for polaris stat spring.cloud.polaris.stat.path=/metrics -logging.level.root=DEBUG \ No newline at end of file +logging.level.root=INFO \ No newline at end of file