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 artifacts to a staging repo in Nexus.
14 # $WORKSPACE/m2repo : Exists and used to deploy the staging repository.
15 # $NEXUS_URL : Jenkins global variable should be defined.
16 # $STAGING_PROFILE_ID : Provided by a job parameter.
18 # Ensure we fail the job if any steps fail.
22 lftools deploy nexus-stage "$NEXUS_URL" "$STAGING_PROFILE_ID" "$WORKSPACE/m2repo" | tee "$TMP_FILE"
23 staging_repo=$(sed -n -e 's/Staging repository \(.*\) created\./\1/p' "$TMP_FILE")
25 # Store repo info to a file in archives
26 mkdir -p "$WORKSPACE/archives"
27 echo "$staging_repo ${NEXUS_URL}/content/repositories/$staging_repo" | tee -a "$WORKSPACE/archives/staging-repo.txt"