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 echo "---> ta-iso-deploy.sh"
14 # Ensure we fail the job if any steps fail.
17 set -x # Trace commands for this script to make debugging easier.
19 set +f # Ensure filename expansion (globbing) is enabled
21 NEXUS_REPO=images-snapshots
22 release_path=TA/images/${JOB_NAME##*-}
24 repo_dir="$WORKSPACE/work/nexus/$NEXUS_REPO"
25 upload_dir1="$repo_dir/$release_path/$BUILD_ID"
26 upload_dir2="$repo_dir/$release_path/latest"
27 nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO"
29 mkdir -p "$upload_dir1"
30 mkdir -p "$upload_dir2"
32 sudo apt install -y rename # "rename" disappeared in Ubuntu 18.04
33 platform_arch=$(uname -m)
34 if [ "${platform_arch}" != 'x86_64' ]; then
35 # On non-x86 architecture, rename the artifacts appropriately
36 pushd "$WORKSPACE/work/results/images/"
37 rename "s/\./.${platform_arch}./" *.*
38 sed -i "s/\./.${platform_arch}./" *."${platform_arch}".iso.*
42 cp "$WORKSPACE/work/results/images/"* "$upload_dir1"
43 cp "$WORKSPACE/work/results/images/"* "$upload_dir2"
45 echo "-----> Upload ISOs to Nexus"
46 lftools deploy nexus "$nexus_repo_url" "$repo_dir"
49 set +x # Disable trace since we no longer need it.
50 echo "ISOs location: <a href=\"$nexus_repo_url\">$nexus_repo_url</a>"