X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fmaven-javadoc-generate.sh;h=ec4743a742df4c367ce1b8ed13f25f603a8c03f9;hb=19cb59a5d60873873f6905b97266a8e919796dbc;hp=405b29b0c90483c50314cb3bb1281870144b6f4b;hpb=c00e75c79a275db041585fe532ab0a36169c3c38;p=releng%2Fglobal-jjb.git diff --git a/shell/maven-javadoc-generate.sh b/shell/maven-javadoc-generate.sh index 405b29b0..ec4743a7 100644 --- a/shell/maven-javadoc-generate.sh +++ b/shell/maven-javadoc-generate.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -8,12 +8,12 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## - +echo "---> maven-javadoc-generate.sh" # Generates javadoc in a Maven project. # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound. # Ensure we fail the job if any steps fail. -set -e -o pipefail +set -xe -o pipefail set +u JAVADOC_DIR="$WORKSPACE/archives/javadoc" @@ -33,3 +33,14 @@ $MVN clean install javadoc:aggregate \ $MAVEN_OPTIONS $MAVEN_PARAMS mv "$WORKSPACE/target/site/apidocs" "$JAVADOC_DIR" + +# TODO: Nexus unpack plugin throws a "504 gateway timeout" for jobs archiving +# large number of small files. Remove the workaround only we move away from +# using Nexus as the log server. +if [[ "$JOB_NAME" =~ "javadoc-verify" ]]; then + # Tarball the javadoc dir and rm the directory to avoid re-upload into logs + pushd "$JAVADOC_DIR" + tar cvJf "$WORKSPACE/archives/javadoc.tar.xz" . + rm -rf "$JAVADOC_DIR" + popd +fi