Add signing to Akraino deploy templates
[ci-management.git] / jjb / shell / ta-rpm-deploy.sh
index bd31a4c..719ec5d 100644 (file)
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/bash -l
 # SPDX-License-Identifier: EPL-1.0
 ##############################################################################
 # Copyright (c) 2017 The Linux Foundation and others.
@@ -16,13 +16,15 @@ 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=rpm.snapshots
 release_path=TA/release-1
 
 repo_dir="$WORKSPACE/work/nexus/$NEXUS_REPO"
 arch_dir="$repo_dir/$release_path/rpms/$(uname -m)"
 sources_dir="$repo_dir/$release_path/rpms/Sources"
-nexus_repo_url="$ALT_NEXUS_URL/repository/$NEXUS_REPO"
+nexus_repo_url="$RPM_REPO_URL/repository/$NEXUS_REPO"
 results_dir="$WORKSPACE/work/results"
 repo_name=`echo $WORKSPACE | awk -F '/' '{print $4}' | cut -d '-' -f2- | sed 's|\(.*\)-.*|\1|'`
 
@@ -37,7 +39,7 @@ mkdir -p "$sources_dir"
 for artifact in \
   `ls $results_dir/repo/*.rpm`
     do
-        if curl --head --fail $nexus_repo_url/$release_path/rpms/$(uname -m)/$(basename $artifact)
+        if curl -L --head --fail $nexus_repo_url/$release_path/rpms/$(uname -m)/$(basename $artifact)
         then
             echo "RPM - $(basename $artifact) already available in Nexus"
             mv $results_dir/repo/$(basename $artifact) $results_dir/repo/duplicates/
@@ -51,7 +53,7 @@ for artifact in \
 for artifact in \
   `ls $results_dir/src_repo/*.rpm`
     do
-        if curl --head --fail $nexus_repo_url/$release_path/rpms/Sources/$(basename $artifact)
+        if curl -L --head --fail $nexus_repo_url/$release_path/rpms/Sources/$(basename $artifact)
         then
             echo "Source RPM - $(basename $artifact) already available in Nexus"
             mv $results_dir/src_repo/$(basename $artifact) $results_dir/src_repo/duplicates/
@@ -61,6 +63,9 @@ for artifact in \
         fi
     done
 
+echo "-----> Sign all artifacts"
+lftools sign sigul "$repo_dir"
+
 echo "-----> Upload RPMs to Nexus"
 lftools deploy nexus "$nexus_repo_url" "$repo_dir"