Skip to content

Commit 43cb638

Browse files
authored
Merge pull request #2327 from ruhan1/main-log
Save and copy build.log
2 parents 908d8a5 + 95c1f1c commit 43cb638

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

java-components/build-request-processor/src/main/java/com/redhat/hacbs/container/build/preprocessor/AbstractPreprocessor.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ private String getContainerFile() {
198198
ENV HTTPS_PROXY=${http_proxy}
199199
COPY .jbs/run-build.sh /var/workdir
200200
COPY . /var/workdir/workspace/source/
201-
RUN /var/workdir/run-build.sh
201+
RUN /var/workdir/run-build.sh 2>&1 | tee /var/workdir/build.log
202202
""".formatted(recipeImage);
203203

204204
if (type == ToolType.ANT) {
@@ -212,12 +212,14 @@ private String getContainerFile() {
212212
RUN /opt/jboss/container/java/run/run-java.sh copy-artifacts --source-path=/var/workdir/workspace/source --deploy-path=/var/workdir/workspace/artifacts
213213
FROM scratch
214214
COPY --from=1 /var/workdir/workspace/artifacts /deployment/
215+
COPY --from=0 /var/workdir/build.log /log/
215216
""".formatted(buildRequestProcessorImage);
216217
} else {
217218
containerFile +=
218219
"""
219220
FROM scratch
220221
COPY --from=0 /var/workdir/workspace/artifacts /deployment/
222+
COPY --from=0 /var/workdir/build.log /log/
221223
""";
222224
}
223225

0 commit comments

Comments
 (0)