From 88962fa12f217f47fc5085abab5a780b7747262c Mon Sep 17 00:00:00 2001 From: Eason <291028775@qq.com> Date: Thu, 16 Mar 2023 23:28:56 +0800 Subject: [PATCH] feat: simplify dev config --- .github/workflows/deploy.yml | 2 +- .github/workflows/release.yml | 2 +- pom.xml | 1 - .../java/org/cloud/sonic/agent/tools/file/UploadTools.java | 5 +---- .../sonic/agent/transport/TransportConnectionThread.java | 6 ++---- src/main/resources/application.yml | 1 - 6 files changed, 5 insertions(+), 12 deletions(-) mode change 100644 => 100755 pom.xml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 8cc3ef59..bb12a7e0 100755 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -61,7 +61,7 @@ jobs: - name: sib run: tar zxvf *_linux_x86_64.tar.gz && rm *_linux_x86_64.tar.gz && mv sib plugins/sonic-ios-bridge - name: deploy - run: mvn package -Dplatform=linux-x86_64 -DreleaseMode=true -Dmaven.test.skip=true + run: mvn package -Dplatform=linux-x86_64 -Dmaven.test.skip=true - name: build image run: docker build -t sonicorg/sonic-agent-linux:${{ steps.previoustag.outputs.tag }} -f src/main/docker/Dockerfile . - name: push diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b89becf..f9e1489a 100755 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -83,7 +83,7 @@ jobs: - name: mkdir run: mkdir -p sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/plugins - name: package - run: mvn clean package -Dplatform=${{ matrix.platform }} -DreleaseMode=true -Dmaven.test.skip=true + run: mvn clean package -Dplatform=${{ matrix.platform }} -Dmaven.test.skip=true - name: mvJar-linux86 run: cp -r target/sonic-agent-${{ matrix.platform }}.jar sonic-agent-${{ steps.previoustag.outputs.tag }}-${{matrix.depend}}/ - name: copy diff --git a/pom.xml b/pom.xml old mode 100644 new mode 100755 index 45b4d11d..267ea2ee --- a/pom.xml +++ b/pom.xml @@ -12,7 +12,6 @@ windows-x86_64 - false 17 17 UTF-8 diff --git a/src/main/java/org/cloud/sonic/agent/tools/file/UploadTools.java b/src/main/java/org/cloud/sonic/agent/tools/file/UploadTools.java index fe265c70..f187c099 100755 --- a/src/main/java/org/cloud/sonic/agent/tools/file/UploadTools.java +++ b/src/main/java/org/cloud/sonic/agent/tools/file/UploadTools.java @@ -49,9 +49,6 @@ public class UploadTools { private String host; @Value("${sonic.server.port}") private String port; - - @Value("${sonic.release-mode}") - private Boolean isRelease; private static String baseUrl; private static RestTemplate restTemplate; @@ -59,7 +56,7 @@ public class UploadTools { @Autowired public void setRestTemplate(RestTemplate restTemplate) { UploadTools.restTemplate = restTemplate; - baseUrl = "http://" + host + ":" + port + (isRelease ? "/server" : "") + "/api/folder".replace(":80/", "/"); + baseUrl = ("http://" + host + ":" + port + "/server/api/folder").replace(":80/", "/"); } public static String upload(File uploadFile, String type) { diff --git a/src/main/java/org/cloud/sonic/agent/transport/TransportConnectionThread.java b/src/main/java/org/cloud/sonic/agent/transport/TransportConnectionThread.java index 31ff4e5b..47851938 100755 --- a/src/main/java/org/cloud/sonic/agent/transport/TransportConnectionThread.java +++ b/src/main/java/org/cloud/sonic/agent/transport/TransportConnectionThread.java @@ -43,8 +43,6 @@ public class TransportConnectionThread implements Runnable { Integer serverPort = Integer.valueOf(SpringTool.getPropertiesValue("sonic.server.port")); String key = String.valueOf(SpringTool.getPropertiesValue("sonic.agent.key")); - boolean isRelease = Boolean.valueOf(SpringTool.getPropertiesValue("sonic.release-mode")); - @Override public void run() { Thread.currentThread().setName(THREAD_NAME); @@ -52,8 +50,8 @@ public void run() { if (!TransportWorker.isKeyAuth) { return; } - String url = String.format("ws://%s:%d%s/websockets/agent/%s", - serverHost, serverPort, isRelease ? "/server" : "", key).replace(":80/", "/"); + String url = String.format("ws://%s:%d/server/websockets/agent/%s", + serverHost, serverPort, key).replace(":80/", "/"); URI uri = URI.create(url); TransportClient transportClient = new TransportClient(uri); transportClient.connect(); diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 999d2fdb..ff1208d8 100755 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -12,7 +12,6 @@ sonic: sib: 1.3.8 sas: 0.1.7 saus: 5.7.4 - release-mode: @releaseMode@ logging: file: