+# Ensure we fail the job if any steps fail
+# Disable 'globbing'
+set -euf -o pipefail
+
+# The 'lftool deploy archives' command below expects the archives
+# directory to exist. Normally lf-infra-sysstat or similar would
+# create it and add content, but to make sure this script is
+# self-contained, we ensure it exists here.
+mkdir -p "$WORKSPACE/archives"
+
+get_pattern_opts () {
+ opts=()
+ for arg in ${ARCHIVE_ARTIFACTS:-}; do
+ opts+=("-p" "$arg")
+ done
+ echo "${opts[@]-}"
+}
+
+pattern_opts=$(get_pattern_opts)
+
+if [[ -z ${LOGS_SERVER:-} ]]; then
+ echo "WARNING: Nexus logging server not set"