ta: ISO upload path: drop "release-1", add arch 64/2264/4
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 27 Feb 2020 17:12:27 +0000 (18:12 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Tue, 3 Mar 2020 16:40:03 +0000 (17:40 +0100)
Previously, TA ISO build used to push artifacts to Nexus repository in
a subdirectory that included in its path the BUILD_ID (Jenkins job ID,
e.g. [1]), but no further specifics like the artifact architecture.
Since amd64 and arm64 build jobs are completely separate, the
BUILD_ID for the two jobs are not correlated in any way, so the arm64
job (since it's newer) pushes artifacts to directories that were
previously created by the amd64 job some time ago (e.g. #109 has amd64
artifacts from August 2019 and arm64 artifacts from February 2020).

This change splits the output artifacts into arch-specific directories,
while dropping the "release-1" subdir from the path, so:
  TA/images/release-1/images/{<BUILD_ID>, latest}
becomes:
  TA/images/<arch>/{<BUILD_ID>,latest}

e.g. instead of [1] we will have [2] and [3].

[1] https://nexus.akraino.org/content/repositories/ \
    images-snapshots/TA/release-1/images/123/
[2] https://nexus.akraino.org/content/repositories/ \
    images-snapshots/TA/images/amd64/56/
[3] https://nexus.akraino.org/content/repositories/ \
    images-snapshots/TA/images/arm64/45/

Change-Id: Ie3e189c1ab61bb9e395663c9882ee869929e0b76
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
jjb/shell/ta-iso-deploy.sh

index 705ac3c..e40eeba 100644 (file)
@@ -19,11 +19,11 @@ 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"
@@ -43,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: <a href=\"$nexus_repo_url\">$nexus_repo_url</a>"