Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOUD-1817 better logging for multiple jars #38

Merged
merged 1 commit into from Jul 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 10 additions & 4 deletions os-java-run/added/run-java.sh
Expand Up @@ -3,6 +3,11 @@
# Fail on a single failed command
set -eo pipefail

if [ "${SCRIPT_DEBUG}" = "true" ] ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure this is documented in the image too, if it isn't already (i.e. image.yaml).

set -x
echo "Script debugging is enabled, allowing bash commands and their arguments to be printed as they are executed"
fi

# ==========================================================
# Generic run script for running arbitrary Java applications
#
Expand Down Expand Up @@ -41,10 +46,11 @@ auto_detect_jar_file() {
ls *.jar | grep -v '^original-'
exit 0
fi

echo >&2 "ERROR: Neither \$JAVA_MAIN_CLASS nor \$JAVA_APP_JAR is set and ${nr_jars} JARs found in ${dir} (1 expected)"
cd ${old_dir}
echo "ERROR: Neither \$JAVA_MAIN_CLASS nor \$JAVA_APP_JAR is set and ${nr_jars} found in ${dir} (1 expected)"
else
echo "ERROR: No directory ${dir} found for auto detection"
echo >&2 "ERROR: No directory ${dir} found for auto detection"
fi
}

Expand All @@ -57,7 +63,7 @@ get_jar_file() {
if [ -f "${jar}" ]; then
echo "${jar}"
else
echo "ERROR: No such file ${jar}"
echo >&2 "ERROR: No such file ${jar}"
fi
else
for dir in $*; do
Expand All @@ -66,7 +72,7 @@ get_jar_file() {
return
fi
done
echo "ERROR: No ${jar} found in $*"
echo >&2 "ERROR: No ${jar} found in $*"
fi
}

Expand Down