2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> logs-deploy.sh"
13 # Ensure we fail the job if any steps fail
17 if [[ -z $"${LOGS_SERVER:-}" ]]; then
18 echo "WARNING: Logging server not set"
20 nexus_url="${NEXUSPROXY:-$NEXUS_URL}"
21 nexus_path="${SILO}/${JENKINS_HOSTNAME}/${JOB_NAME}/${BUILD_NUMBER}"
22 echo "INFO: Nexus URL $nexus_url path $nexus_path"
24 if [[ -n ${ARCHIVE_ARTIFACTS:-} ]] ; then
25 # Handle multiple search extensions as separate values to '-p|--pattern'
26 # "arg1 arg2" -> (-p arg1 -p arg2)
28 for arg in $ARCHIVE_ARTIFACTS; do
29 pattern_opts+=("-p" "$arg")
31 echo "INFO: archiving workspace using pattern(s): $ARCHIVE_ARTIFACTS"
32 lftools deploy archives "${pattern_opts[@]}" \
33 "$nexus_url" "$nexus_path" "$WORKSPACE"
35 echo "INFO: archiving workspace"
36 lftools deploy archives "$nexus_url" "$nexus_path" "$WORKSPACE"
38 echo "INFO: archiving logs"
39 lftools deploy logs "$nexus_url" "$nexus_path" "${BUILD_URL:-}"
41 echo "Build logs: <a href=\"$LOGS_SERVER/$nexus_path\">$LOGS_SERVER/$nexus_path</a>"