Code Review
/
releng
/
global-jjb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix shellcheck errors in scripts
[releng/global-jjb.git]
/
shell
/
maven-javadoc-generate.sh
diff --git
a/shell/maven-javadoc-generate.sh
b/shell/maven-javadoc-generate.sh
index
299559d
..
4a66eec
100644
(file)
--- a/
shell/maven-javadoc-generate.sh
+++ b/
shell/maven-javadoc-generate.sh
@@
-1,4
+1,4
@@
-#!/bin/bash
-l
+#!/bin/bash
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2017 The Linux Foundation and others.
# SPDX-License-Identifier: EPL-1.0
##############################################################################
# Copyright (c) 2017 The Linux Foundation and others.
@@
-21,27
+21,36
@@
mkdir -p "$WORKSPACE/archives"
export MAVEN_OPTS
export MAVEN_OPTS
+# use absolute path as workaround for javadoc:aggregate
+# silent failure on relative path, for example "-f ."
+maven_dir_abs=$(readlink -f "$MAVEN_DIR")
+
# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
# shellcheck disable=SC2086
# Disable SC2086 because we want to allow word splitting for $MAVEN_* parameters.
# shellcheck disable=SC2086
-$MVN clean install javadoc:aggregate \
+# Use -x via subshell to show maven invocation details in the log
+(set -x
+ $MVN clean install javadoc:aggregate \
+ -f "$maven_dir_abs" \
-e -Pq -Dmaven.javadoc.skip=false \
-DskipTests=true \
-Dcheckstyle.skip=true \
-Dfindbugs.skip=true \
--global-settings "$GLOBAL_SETTINGS_FILE" \
--settings "$SETTINGS_FILE" \
-e -Pq -Dmaven.javadoc.skip=false \
-DskipTests=true \
-Dcheckstyle.skip=true \
-Dfindbugs.skip=true \
--global-settings "$GLOBAL_SETTINGS_FILE" \
--settings "$SETTINGS_FILE" \
- -f "$MAVEN_DIR" \
$MAVEN_OPTIONS $MAVEN_PARAMS
$MAVEN_OPTIONS $MAVEN_PARAMS
+)
mv "$WORKSPACE/$MAVEN_DIR/target/site/apidocs" "$JAVADOC_DIR"
# TODO: Nexus unpack plugin throws a "504 gateway timeout" for jobs archiving
mv "$WORKSPACE/$MAVEN_DIR/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
+# large number of small files. Remove the workaround
when
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
# 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
+ tarball="$WORKSPACE/archives/javadoc.tar.xz"
+ echo "INFO: archiving $JAVADOC_DIR as $tarball"
pushd "$JAVADOC_DIR"
pushd "$JAVADOC_DIR"
- tar cvJf "$WORKSPACE/archives/javadoc.tar.xz" .
- rm -rf "$JAVADOC_DIR"
+ tar cvJf "$tarball" .
popd
popd
+ rm -rf "$JAVADOC_DIR"
fi
fi