Skip to content

Commit

Permalink
feat: simplify dev config
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouYixun committed Mar 16, 2023
1 parent e0d584a commit 88962fa
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion pom.xml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<properties>
<!-- [ "windows-x86", "windows-x86_64", "macosx-arm64", "macosx-x86_64", "linux-arm64", "linux-x86", "linux-x86_64" ]-->
<platform>windows-x86_64</platform>
<releaseMode>false</releaseMode>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,14 @@ 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;

@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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,15 @@ 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);
if (TransportWorker.client == null) {
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();
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ sonic:
sib: 1.3.8
sas: 0.1.7
saus: 5.7.4
release-mode: @releaseMode@

logging:
file:
Expand Down

0 comments on commit 88962fa

Please sign in to comment.