|
@@ -120,24 +120,19 @@ public class JavaImageBuildHandler extends AbstractHandler {
|
|
|
StringBuilder sb = new StringBuilder();
|
|
StringBuilder sb = new StringBuilder();
|
|
|
try {
|
|
try {
|
|
|
dockerApi.buildAndPush(directory.toString(), "seecoder-devcloud-" + imageName, imageTag, new ProgressHandler() {
|
|
dockerApi.buildAndPush(directory.toString(), "seecoder-devcloud-" + imageName, imageTag, new ProgressHandler() {
|
|
|
- @Override
|
|
|
|
|
- public void progress(ProgressMessage message) throws DockerException {
|
|
|
|
|
- String value = message.stream();
|
|
|
|
|
- if (value == null) {
|
|
|
|
|
- value = "";
|
|
|
|
|
- }
|
|
|
|
|
- if (!StringUtils.isEmpty(message.error())) {
|
|
|
|
|
- value += "\n" + message.error();
|
|
|
|
|
- sb.append(value);
|
|
|
|
|
- System.out.println(sb.toString());
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void progress(ProgressMessage message) throws DockerException {
|
|
|
|
|
+ if (!StringUtils.isEmpty(message.error())) {
|
|
|
|
|
+ sb.append(message.error()+"\n");
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
- context.setResult(context.getResult() + sb.toString());
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- } catch (Exception e) {
|
|
|
|
|
- context.appendErrorResult(PipelineException.IMAGE_BUILD_ERROR,e);
|
|
|
|
|
- throw new PipelineException(HttpStatus.SC_SERVICE_UNAVAILABLE, PipelineException.IMAGE_BUILD_ERROR ,e);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ context.appendErrorResult(PipelineException.IMAGE_BUILD_ERROR,e);
|
|
|
|
|
+ context.setResult(context.getResult() + "IMAGE BUILD DETAILS:" + sb.toString());
|
|
|
|
|
+ throw new PipelineException(HttpStatus.SC_SERVICE_UNAVAILABLE, PipelineException.IMAGE_BUILD_ERROR ,e);
|
|
|
|
|
+ }
|
|
|
//6. 将镜像名字加入context
|
|
//6. 将镜像名字加入context
|
|
|
context.getConfigs().put("imageName", imageName);
|
|
context.getConfigs().put("imageName", imageName);
|
|
|
context.getConfigs().put("imageTag", imageTag);
|
|
context.getConfigs().put("imageTag", imageTag);
|