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 ##############################################################################
12 # This script publishes packages (rpms/debs) or any file to Nexus hosted
15 # $MAVEN_REPO_URL : Provided by a job parameter.
16 # The calling job can set $NEXUS_URL path or local
17 # directory to stage files. ex:
18 # -Durl="${NEXUS_URL}/content/repositories/$REPO_ID"
19 # -Durl="file://$WORKSPACE/m2repo"
20 # $REPO_ID : Provided by a job parameter.
21 # A repository ID represents the repository.
22 # $GROUP_ID : Provided by a job parameter.
23 # A group ID represents a nexus group.
24 # $UPLOAD_FILES_PATH : Provided by a job parameter.
25 # The directory contains one or more artifacts.
27 echo "---> deploy-maven-file.sh"
29 # DO NOT enable -u because $MAVEN_PARAMS and $MAVEN_OPTIONS could be unbound.
30 # Ensure we fail the job if any steps fail.
37 DEPLOY_LOG="$WORKSPACE/archives/deploy-maven-file.log"
38 mkdir -p "$WORKSPACE/archives"
40 while IFS="" read -r file
42 lftools deploy maven-file "$MAVEN_REPO_URL" \
47 -p "$MAVEN_PARAMS $MAVEN_OPTIONS" \
49 done < <(find "$UPLOAD_FILES_PATH" -type f -name "*")