X-Git-Url: https://gerrit.akraino.org/r/gitweb?p=ci-management.git;a=blobdiff_plain;f=jjb%2Fshell%2Fta-iso-deploy.sh;h=e40eebaf5f6a57a5c2bb56d595b4bbce1c8ced06;hp=c9d55595f2db4e6ee3ce8ee0ad5dc41c5573dfc7;hb=683452330b0784c355d032aae4454674d7fdc60e;hpb=d82f046b536a4832d1a7733f2e6059f1446bae81 diff --git a/jjb/shell/ta-iso-deploy.sh b/jjb/shell/ta-iso-deploy.sh index c9d5559..e40eeba 100644 --- a/jjb/shell/ta-iso-deploy.sh +++ b/jjb/shell/ta-iso-deploy.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -l # SPDX-License-Identifier: EPL-1.0 ############################################################################## # Copyright (c) 2017 The Linux Foundation and others. @@ -16,21 +16,25 @@ set -eu -o pipefail set -x # Trace commands for this script to make debugging easier. +set +f # Ensure filename expansion (globbing) is enabled + NEXUS_REPO=images-snapshots -release_path=TA/release-1 +release_path=TA/images/${JOB_NAME##*-} repo_dir="$WORKSPACE/work/nexus/$NEXUS_REPO" -upload_dir1="$repo_dir/$release_path/images/$BUILD_ID" -upload_dir2="$repo_dir/$release_path/images/latest" +upload_dir1="$repo_dir/$release_path/$BUILD_ID" +upload_dir2="$repo_dir/$release_path/latest" nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO" mkdir -p "$upload_dir1" mkdir -p "$upload_dir2" -if [ "$(uname -m)" != 'x86_64' ]; then +platform_arch=$(uname -m) +if [ "${platform_arch}" != 'x86_64' ]; then # On non-x86 architecture, rename the artifacts appropiately pushd "$WORKSPACE/work/results/images/" - rename "s/\./.$(uname -m)./" *.* + rename "s/\./.${platform_arch}./" *.* + sed -i "s/\./.${platform_arch}./" *."${platform_arch}".iso.* popd fi @@ -39,6 +43,7 @@ cp "$WORKSPACE/work/results/images/"* "$upload_dir2" echo "-----> Upload ISOs to Nexus" lftools deploy nexus "$nexus_repo_url" "$repo_dir" +rm -rf "$repo_dir" set +x # Disable trace since we no longer need it. echo "ISOs location: $nexus_repo_url"