retrieve jenkins console output
Posted 白衣胜雪
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了retrieve jenkins console output相关的知识,希望对你有一定的参考价值。
@Api(value = "console", description = "Retrieve the Console Outputs",produces=MediaType.APPLICATION_JSON_VALUE)
@Controller
public class ConsoleController {
@RequestMapping(value = "/consoleLogs/{job}", method = RequestMethod.GET)
@ResponseStatus(HttpStatus.OK)
@ApiOperation(value = "Getting jenkins console outputs", notes = "Getting jenkins console outputs")
@ResponseBody public String getConsoleOutputs(@ApiParam(value="url",required=true)@PathVariable(value = "job") String job)
throws Exception {
StringBuilder result = new StringBuilder();
URL url = new URL("http://localhost:8080/job/"+job+"/lastBuild/logText/progressiveText?start=0");
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("GET");
conn.setConnectTimeout(30000);
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
result.append(line);
}
rd.close();
return result.toString();
}
}
以上是关于retrieve jenkins console output的主要内容,如果未能解决你的问题,请参考以下文章
导轨。我在 Stripe::Customer.retrieve("cus_XYZ") 控制台中看不到我的计划订阅