2 # @License EPL-1.0 <http://spdx.org/licenses/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 ##############################################################################
12 # This script publishes packages (rpms/debs) or any file to Nexus hosted
15 # $NEXUS_URL : Jenkins global variable should be defined.
16 # $REPO_ID : Provided by a job parameter.
17 # $GROUP_ID : Provided by a job parameter.
18 # $UPLOAD_FILES_PATH : Provided by a job parameter.
19 echo "---> deploy-maven-file.sh"
20 # Ensure we fail the job if any steps fail.
23 DEPLOY_LOG="$WORKSPACE/archives/deploy-maven-file.log"
24 mkdir -p "$WORKSPACE/archives"
26 NEXUS_REPO_URL="${NEXUS_URL}/$REPO_ID"
28 while IFS="" read -r file
30 lftools deploy maven-file "$NEXUS_REPO_URL" \
34 -g "$GROUP_ID" | tee "$DEPLOY_LOG"
35 done < <(find "$UPLOAD_FILES_PATH" -type f -name "*")