sureops
This commit is contained in:
parent
8f27b9b92a
commit
459ed5fdbf
@ -1,8 +1,6 @@
|
|||||||
package com.realnet.OpenAi.Controller;
|
package com.realnet.OpenAi.Controller;
|
||||||
|
|
||||||
import java.io.BufferedWriter;
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import java.util.Map;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
@ -36,6 +37,9 @@ public class ScriptSrvice {
|
|||||||
@Value("${projectPath}")
|
@Value("${projectPath}")
|
||||||
private String projectPath;
|
private String projectPath;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SureopsService sureopsService;
|
||||||
|
|
||||||
public void Createonefile(Integer prj_id, List<String> lineList, String workflow_model, Long Deployment_profile)
|
public void Createonefile(Integer prj_id, List<String> lineList, String workflow_model, Long Deployment_profile)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
@ -126,6 +130,7 @@ public class ScriptSrvice {
|
|||||||
// ArrayList<Object> list = calldeploymentprofile(Deployment_profile);
|
// ArrayList<Object> list = calldeploymentprofile(Deployment_profile);
|
||||||
ArrayList<Object> list = new ArrayList<>();
|
ArrayList<Object> list = new ArrayList<>();
|
||||||
String pROTOCOL = PortConstant.PROTOCOL;
|
String pROTOCOL = PortConstant.PROTOCOL;
|
||||||
|
Long serverPort = sureopsService.getUpdatedPort(1L);
|
||||||
|
|
||||||
ArrayList<Object> getdatafromgiturl = getdatafromgiturl(gitea_url);
|
ArrayList<Object> getdatafromgiturl = getdatafromgiturl(gitea_url);
|
||||||
|
|
||||||
@ -234,8 +239,9 @@ public class ScriptSrvice {
|
|||||||
|
|
||||||
String replace11 = replace10.replace("<PROTOCOL>", pROTOCOL);
|
String replace11 = replace10.replace("<PROTOCOL>", pROTOCOL);
|
||||||
String replace12 = replace11.replace("<PRJ_NAME>", list.get(6).toString().replace("\"", ""));
|
String replace12 = replace11.replace("<PRJ_NAME>", list.get(6).toString().replace("\"", ""));
|
||||||
|
String replace13 = replace12.replace("<SERVER_PORT>", serverPort.toString());
|
||||||
|
|
||||||
String finalreplace_value = replace12.replace("<MSG>",
|
String finalreplace_value = replace13.replace("<MSG>",
|
||||||
"\"" + list.get(7).toString().replace("\"", "") + "\"");
|
"\"" + list.get(7).toString().replace("\"", "") + "\"");
|
||||||
|
|
||||||
// for testing
|
// for testing
|
||||||
|
|||||||
@ -43,7 +43,7 @@ public class SureopsService {
|
|||||||
|
|
||||||
String index = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + " <title>Welcome</title>\n" + "</head>\n"
|
String index = "<!DOCTYPE html>\n" + "<html>\n" + "<head>\n" + " <title>Welcome</title>\n" + "</head>\n"
|
||||||
+ "<body>\n" + " <h1>Welcome to the Web App</h1>\n" + " <ul>\n"
|
+ "<body>\n" + " <h1>Welcome to the Web App</h1>\n" + " <ul>\n"
|
||||||
+ " <li><a href=\"Home.html\">Home Page</a></li>\n" + " </ul>\n" + "</body>\n" + "</html>";
|
+ " <li><a href=\"home.html\">Home Page</a></li>\n" + " </ul>\n" + "</body>\n" + "</html>";
|
||||||
|
|
||||||
String filename = "index.html";
|
String filename = "index.html";
|
||||||
fileHelper.createFile(folderPath, filename, index);
|
fileHelper.createFile(folderPath, filename, index);
|
||||||
@ -58,6 +58,18 @@ public class SureopsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getUpdatedPort(Long webid) {
|
||||||
|
|
||||||
|
String url = PortConstant.SUREOPS_DOMAIN + "/sureops/resource/port";
|
||||||
|
|
||||||
|
ResponseEntity<Object> get = GET(url);
|
||||||
|
|
||||||
|
Object body = get.getBody();
|
||||||
|
Long port = Long.valueOf(body.toString());
|
||||||
|
return port;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public ResponseEntity<Object> GET(String get) {
|
public ResponseEntity<Object> GET(String get) {
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user